Firebase / AngularFire related error when loading
See original GitHub issueI’m submitting a…
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
In package
[ ] @ng-toolkit/init
[ ] @ng-toolkit/serverless
[x] @ng-toolkit/universal
Current behavior
npm run server
Some firebase related warning show in the console but seems to compile ok. When refreshing at localhost:8080 a blank screen with two curly brackets {} is loaded.
The console shows
ERROR TypeError: Cannot read property 'filter' of undefined at _firebaseAppFactory (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:53335:174) at /Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:153550:66 at ZoneDelegate.module.exports.ZoneDelegate.invoke (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:199616:26) at Zone.module.exports.Zone.run (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:199366:43) at NgZone.module.exports.NgZone.runOutsideAngular (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:4068:28) at new AngularFireDatabase (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:153549:30) at _createClass (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8575:20) at _createProviderInstance$1 (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8537:26) at resolveNgModuleDep (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8500:21) at _createClass (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8567:68) TypeError: Cannot read property 'filter' of undefined at _firebaseAppFactory (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:53335:174) at /Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:153550:66 at ZoneDelegate.module.exports.ZoneDelegate.invoke (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:199616:26) at Zone.module.exports.Zone.run (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:199366:43) at NgZone.module.exports.NgZone.runOutsideAngular (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:4068:28) at new AngularFireDatabase (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:153549:30) at _createClass (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8575:20) at _createProviderInstance$1 (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8537:26) at resolveNgModuleDep (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8500:21) at _createClass (/Users/alejandroquadri/Dev/webs/quadri-web/dist/server.js:8567:68)
app compiles perfectly when running
ng serve
Minimal reproduction of the problem with instructions
just run npm run server
and try to load at localhost:8080
Example repository
https://github.com/alejandroquadri/quadri-web.git seo-friendly branch
Environment
Angular CLI: 6.0.8 Node: 8.11.3 OS: darwin x64 Angular: 6.0.7
Browser:
- Chrome (desktop) version 67.0.3396.99 (Build oficial) (64 bits)
- Chrome (Android) version XX
- Chrome (iOS) version XX
- Firefox version XX
- Safari (desktop) version XX
- Safari (iOS) version XX
- IE version XX
- Edge version XX
For Tooling issues:
- Node version: 8.11.3
- Platform: Mac
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
This is apparently an issue with Angularfire2 (see thread https://github.com/angular/angularfire2/issues/1705). The solution of anasbaddyr works for me : " Using rc.11 i went to node_modules/angularfire2/firebase.app.module.js I changed import * as firebase from ‘firebase/app’; to import firebase from ‘firebase/app’; "
@Konondo that didn’t work for me, using rc.11 changed same line, got same result.