Angular ../node_modules/Nativescript插件firebase/firebase.js中的Nativescript错误
我正在使用Nativescript和代码共享开发一个应用程序。在几天前升级到Angular 10之后,一切都很好。今天,我想用该插件实现Firebase,但当我尝试运行我的应用程序时,出现以下错误:Angular ../node_modules/Nativescript插件firebase/firebase.js中的Nativescript错误,angular,firebase,webpack,nativescript,nativescript-angular,Angular,Firebase,Webpack,Nativescript,Nativescript Angular,我正在使用Nativescript和代码共享开发一个应用程序。在几天前升级到Angular 10之后,一切都很好。今天,我想用该插件实现Firebase,但当我尝试运行我的应用程序时,出现以下错误: ERROR in ../node_modules/nativescript-plugin-firebase/firebase.js Module not found: Error: Can't resolve 'tns-core-modules/application/application' E
ERROR in ../node_modules/nativescript-plugin-firebase/firebase.js
Module not found: Error: Can't resolve 'tns-core-modules/application/application'
ERROR in ../node_modules/nativescript-plugin-firebase/messaging/messaging.js
Module not found: Error: Can't resolve 'tns-core-modules/application/application'
ERROR in ../node_modules/nativescript-plugin-firebase/admob/admob.js
Module not found: Error: Can't resolve 'tns-core-modules/platform/platform'
ERROR in ../node_modules/nativescript-plugin-firebase/messaging/messaging.js
Module not found: Error: Can't resolve 'tns-core-modules/platform/platform'
我假设它是由Webpack抛出的,因为它是在Webpack编译期间记录的。
My package.json看起来有点像这样:
{
"name": "application-name",
"nativescript": {
"id": "my.nativescript.app",
"tns-ios": {
"version": "6.5.2"
},
"tns-android": {
"version": "6.5.3"
}
},
"version": "0.0.0",
"scripts": {
// some scripts
},
"dependencies": {
"@angular/animations": "~10.0.0",
"@angular/common": "~10.0.0",
"@angular/compiler": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@nativescript/angular": "~10.0.0",
"@nativescript/core": "rc",
"@nativescript/theme": "~2.2.1",
"core-js": "^2.6.9",
"nativescript-plugin-firebase": "^10.5.2",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.5.5",
"tslib": "1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.2",
"@angular/cli": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@nativescript/tslint-rules": "~0.0.5",
"@nativescript/webpack": "~2.0.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"node-sass": "^4.7.1",
"protractor": "~5.4.3",
"tns-platform-declarations": "^6.5.15",
"ts-node": "~8.3.0",
"tslint": "^5.20.1",
"typescript": "~3.9.0"
}
}
为了理解错误,我尝试将上述文件中的导入更改为tns核心模块/应用程序
等等。编译工作正常,但应用程序在我的模拟器上一启动就崩溃了。我还尝试了@nativescript/core/application/application
。我也犯了同样的错误
我不知道如何解决此问题,因此我将非常感谢您的帮助。我可以使用“@nativescript/firebase”:“^11.0.0-rc.0”解决此问题。 从@nativescript/firebase导入*作为firebase 检查此链接: