angular - 将 angularfire2 升级到 @angular/fire 后出错
问题描述
我开始绝望了,我有我的小 Angular 6 应用程序。我已经从(我认为是)angularfire2 v3 升级到@angular/fire
我根据从 v4 到 v5 的升级进行了所有更改(使用并包括对应的 AngularFire 库)并删除了所有 AngularFireObservables/Objects
我仍然有一个编译错误:
...
ERROR in Cannot read property 'getSymbolByModule' of undefined
ERROR in D:/Code/workouttracker/src/app/app.routes.ts (70,22): Generic type 'Mod
uleWithProviders<T, any>' requires 2 type argument(s).
ERROR in D:/Code/workouttracker/src/app/service/user.service.ts (27,24): 'fireba
se' refers to a UMD global, but the current file is a module. Consider adding an
import instead.
D:/Code/workouttracker/src/app/service/user.service.ts (28,27): 'firebase' refer
s to a UMD global, but the current file is a module. Consider adding an import i
nstead.
D:/Code/workouttracker/src/app/service/user.service.ts (34,26): 'firebase' refer
s to a UMD global, but the current file is a module. Consider adding an import i
nstead.
D:/Code/workouttracker/src/app/service/user.service.ts (39,26): 'firebase' refer
s to a UMD global, but the current file is a module. Consider adding an import i
nstead.
ERROR in D:/Code/workouttracker/src/app/service/authguard.service.ts (8,31): Can
not find name 'AngularFireAuth'.
D:/Code/workouttracker/src/app/service/authguard.service.ts (12,14): Cannot find
name 'Observable'.
ERROR in D:/Code/workouttracker/src/app/login/login.component.ts (19,20): Proper
ty 'subscribe' does not exist on type 'Auth'.
ERROR in (webpack)-dev-server/client/socket.js
Module not found: Error: Can't resolve 'sockjs-client' in 'D:\Code\workouttracke
r\node_modules\webpack-dev-server\client'
@ (webpack)-dev-server/client/socket.js 1:13-37
@ (webpack)-dev-server/client?http://localhost:4200
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
我已经尝试了不同版本的 firebase 和 @angular/fire,我完全删除了 node_modules 并通过 npm install 重新安装,这是我当前的 package.json
{
"name": "workouttracker",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/fire": "^5.0.2",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"core-js": "^2.5.4",
"firebase": "^5.5.1",
"rxjs": "~6.2.0",
"strip-ansi": "^4.0.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.1",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
有任何想法吗?也许你有类似的东西。
角度:6 角度 CLI:1.0.0 节点 JS:8.12.0
解决方案
推荐阅读
- c++ - pow 在 CUDA 的 __device__ 函数中无法正常工作
- javascript - 我为什么要关心在浏览器中取消 ajax 请求?
- r - 根据上下文绘制数据可视化图
- android - 如何处理flutter_bluetooth_serial包中的String数据?
- mysql - MacOS MySQL_8的where子句中TINYINT UNSIGNED数据列不能减
- c++ - 删除数组时“free():在 tcache 2 中检测到双重空闲”
- python - 如何为 Django 项目中的帖子创建评论模型
- ruby-on-rails - 折叠的导航栏没有在 Rails 应用程序中使用 Bootstrap 扩展
- reactjs - 可重用组件原因警告:无法从不同组件的函数体内更新组件
- node.js - mongoose populate() 不适用于 find()