Ste*_*tar 2 firebase angularfire2 angular angular6
因此,我正在使用Angular 6使用AngularFire2构建Web应用程序,并且在加载应用程序时出现以下错误:
auth.js:255 Uncaught ReferenceError: global is not defined
at Object../node_modules/firebase/auth.js (auth.js:255)
at __webpack_require__ (bootstrap:81)
at Object../node_modules/firebase/firebase-browser.js (firebase-browser.js:11)
at __webpack_require__ (bootstrap:81)
at Object../src/app/core/auth.service.ts (auth.guard.ts:18)
at __webpack_require__ (bootstrap:81)
at Object../src/app/app.component.ts (main.js:156)
at __webpack_require__ (bootstrap:81)
at Object../src/app/app.module.ts (app.component.ts:9)
at __webpack_require__ (bootstrap:81)
./node_modules/firebase/auth.js @ auth.js:255
__webpack_require__ @ bootstrap:81
./node_modules/firebase/firebase-browser.js @ firebase-browser.js:11
__webpack_require__ @ bootstrap:81
./src/app/core/auth.service.ts @ auth.guard.ts:18
__webpack_require__ @ bootstrap:81
./src/app/app.component.ts @ main.js:156
__webpack_require__ @ bootstrap:81
./src/app/app.module.ts @ app.component.ts:9
__webpack_require__ @ bootstrap:81
./src/main.ts @ environment.ts:15
__webpack_require__ @ bootstrap:81
0 @ main.ts:14
__webpack_require__ @ bootstrap:81
checkDeferredModules @ bootstrap:43
webpackJsonpCallback @ bootstrap:30
(anonymous) @ main.js:1
Run Code Online (Sandbox Code Playgroud)
我不确定这是否与我拥有的angular版本有关,但我有一个使用Angular 4使用这两个库的ionic应用程序,并且运行良好。
以下是相关的软件包:
"@angular/animations": "^6.0.1",
"@angular/common": "^6.0.1",
"@angular/compiler": "^6.0.1",
"@angular/core": "^6.0.1",
"@angular/forms": "^6.0.1",
"@angular/http": "^6.0.1",
"@angular/platform-browser": "^6.0.1",
"@angular/platform-browser-dynamic": "^6.0.1",
"@angular/platform-server": "^6.0.1",
"@angular/pwa": "^0.6.1",
"@angular/router": "^6.0.1",
"@angular/service-worker": "^6.0.1",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"angularfire2": "^4.0.0-rc.1",
"core-js": "^2.5.4",
"firebase": "^3.9.0"
Run Code Online (Sandbox Code Playgroud)
我在这里使用的AngularFire和Firebase版本缺少某些内容吗?