我刚刚将现有的Angular v4.3应用程序升级到了6,包括将rxjs 5.5升级到6.3.3。我还安装了rxjs-compat软件包,并运行了rxjs-5-to-6-migrate -p src / tsconfig.app.json命令来更新RXJS参考。 Webpack编译正常,但是当我运行该应用程序时,出现以下控制台错误。
我该如何调试它并实际在代码中找到它的来源?
zone.js:569 Unhandled Promise rejection: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. ; Zone: <root> ; Task: Promise.then ; Value: TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
at subscribeTo (subscribeTo.js:41)
at Function.from (from.js:17)
at new AppStore (app-store.js:12)
at app-store-factory.js:57
at _callFactory (core.js:8431)
at _createProviderInstance (core.js:8389)
at initNgModule (core.js:8319)
at new NgModuleRef_ (core.js:9045)
at createNgModuleRef (core.js:9034)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:10859)
at NgModuleFactory_.create (core.js:11576)
at core.js:4305
at ZoneDelegate.invoke (zone.js:365)
at Object.onInvoke (core.js:3820)
at ZoneDelegate.invoke (zone.js:364) TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
at subscribeTo (https://localhost:44345/dist/app.bundle.js?131969704514023556:74518:15)
at Function.from (https://localhost:44345/dist/app.bundle.js?131969704514023556:44015:177)
at new AppStore (https://localhost:44345/dist/app.bundle.js?131969704514023556:62582:47)
at https://localhost:44345/dist/app.bundle.js?131969704514023556:122527:16
at _callFactory (https://localhost:44345/dist/app.bundle.js?131969704514023556:8734:20)
at _createProviderInstance (https://localhost:44345/dist/app.bundle.js?131969704514023556:8692:26)
at initNgModule (https://localhost:44345/dist/app.bundle.js?131969704514023556:8622:32)
at new NgModuleRef_ (https://localhost:44345/dist/app.bundle.js?131969704514023556:9348:9)
at createNgModuleRef (https://localhost:44345/dist/app.bundle.js?131969704514023556:9337:12)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (https://localhost:44345/dist/app.bundle.js?131969704514023556:11162:12)
at NgModuleFactory_.create (https://localhost:44345/dist/app.bundle.js?131969704514023556:11879:25)
at https://localhost:44345/dist/app.bundle.js?131969704514023556:4608:43
at ZoneDelegate.invoke (https://localhost:44345/dist/polyfills.bundle.js:5189:26)
at Object.onInvoke (https://localhost:44345/dist/app.bundle.js?131969704514023556:4123:33)
at ZoneDelegate.invoke (https://localhost:44345/dist/polyfills.bundle.js:5188:32)
我的package.json如下。
{
"name": "srm-portal",
"version": "1.0.0",
"description": "",
"main": "wwwroot/index.html",
"author": "",
"license": "ISC",
"scripts": {
"ngc": "ngc -p ./tsconfig-aot.json",
"start": "concurrently \"webpack-dev-server --hot --inline --port 8080\" \"dotnet run\" ",
"webpack-dev": "set NODE_ENV=development && webpack",
"webpack-production": "set NODE_ENV=production && webpack",
"build-dev": "npm run webpack-dev",
"build-production": "npm run ngc && npm run webpack-production",
"watch-webpack-dev": "set NODE_ENV=development && webpack --watch --color",
"watch-webpack-production": "npm run build-production --watch --color",
"publish-for-iis": "npm run build-production && dotnet publish -c Release"
},
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/cli": "^7.3.5",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/platform-server": "^6.0.0",
"@angular/router": "^6.0.0",
"@angular/upgrade": "~4.3.0",
"@progress/kendo-angular-pdf-export": "^1.2.0",
"@progress/kendo-drawing": "^1.5.8",
"angular-in-memory-web-api": "0.3.2",
"angular2-chartjs": "^0.2.0",
"angular2-notifications": "^0.7.4",
"angular2-redux": "^4.0.0",
"core-js": "^2.5.6",
"date-input-polyfill": "^2.14.0",
"font-awesome": "4.7.0",
"ie-shim": "~0.1.0",
"linkifyjs": "^2.1.4",
"ng2-appinsights": "^1.0.0-beta.1",
"ng2-currency-mask": "^4.3.1",
"ng2-dnd": "^4.2.0",
"ng2-toasty": "^4.0.3",
"ng2-validation": "^4.2.0",
"ngx-chips": "1.5.3",
"ngx-pagination": "3.0.3",
"powerbi-client": "^2.4.7",
"primeicons": "^1.0.0",
"primeng": "^6.1.7",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0",
"reflect-metadata": "0.1.10",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.4.0",
"zone.js": "0.8.5"
},
"devDependencies": {
"@types/node": "7.0.5",
"angular-router-loader": "^0.6.0",
"angular2-template-loader": "0.6.2",
"awesome-typescript-loader": "3.1.2",
"clean-webpack-plugin": "^0.1.16",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"file-loader": "^0.11.1",
"html-webpack-plugin": "^2.28.0",
"json-loader": "^0.5.4",
"node-sass": "^4.5.3",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.3",
"source-map-loader": "^0.2.1",
"style-loader": "^0.16.1",
"ts-helpers": "^1.1.2",
"tslint": "^5.1.0",
"tslint-loader": "^3.5.2",
"typescript": "2.5.3",
"url-loader": "^0.5.8",
"webpack": "^2.4.1",
"webpack-dev-server": "2.4.2"
},
"-vs-binding": {
"ProjectOpened": [
"watch-webpack-dev"
]`enter code here`
}
}