gpt4 book ai didi

server-side-rendering - ERROR 错误 : Uncaught (in promise): TypeError: i. BehaviorSubject 不是 Angular 10 SSR 中的构造函数

转载 作者:行者123 更新时间:2023-12-03 15:59:41 26 4
gpt4 key购买 nike

请帮我解决问题:enter image description here
成功构建并在具有角度通用的浏览器上运行后,我遇到了这个问题
这是我的包 json :

{
"name": "ssr",
"version": "1.0.0",
"private": true,
"dependencies": {
"@angular/animations": "10.0.5",
"@angular/cdk": "10.1.0",
"@angular/common": "10.0.5",
"@angular/compiler": "10.0.5",
"@angular/core": "10.0.5",
"@angular/fire": "^6.0.2",
"@angular/forms": "10.0.5",
"@angular/http": "^7.2.16",
"@angular/localize": "^10.0.5",
"@angular/material": "10.1.0",
"@angular/material-moment-adapter": "10.1.0",
"@angular/platform-browser": "10.0.5",
"@angular/platform-browser-dynamic": "10.0.5",
"@angular/platform-server": "^10.0.5",
"@angular/router": "10.0.5",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@ng-toolkit/universal": "^8.1.0",
"@nguniversal/express-engine": "^10.0.1",
"@types/jquery": "^3.5.1",
"@types/node": "^8.10.62",
"angular-in-memory-web-api": "^0.11.0",
"angular-ng-autocomplete": "^2.0.1",
"classlist.js": "^1.1.20150312",
"codelyzer": "^6.0.0",
"core-js": "2.6.9",
"crypto-js": "^3.3.0",
"express": "^4.15.2",
"firebase": "^7.17.1",
"hammerjs": "^2.0.8",
"jquery": "^3.5.1",
"localstorage-polyfill": "^1.0.1",
"moment": "2.24.0",
"ng2-slim-loading-bar": "^4.0.0",
"ng5-slider": "^1.1.14",
"ngx-order-pipe": "^2.0.4",
"ngx-pagination": "^3.2.1",
"ngx-spinner": "^10.0.1",
"rxjs": "^6.6.0",
"rxjs-compat": "^6.6.0",
"sweetalert2": "^8.19.0",
"tslib": "^1.13.0",
"web-animations-js": "^2.3.2",
"whatwg-fetch": "^3.2.0",
"zone.js": "0.10.3"
},

最佳答案

我刚刚将我的项目更新到 Angular 10 并开始面临这个问题。
我所做的是,无论我在哪里有 BehaviorSubject 导入,
我从 改变了它们从“rxjs/Rx”导入 { BehaviorSubject }; 导入 { BehaviorSubject } 来自“rxjs”;
这使得生产构建工作没有任何错误。

关于server-side-rendering - ERROR 错误 : Uncaught (in promise): TypeError: i. BehaviorSubject 不是 Angular 10 SSR 中的构造函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63171295/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com