-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 6 SSR build issue #1705
Comments
I'm having the same issue with version angularfire2@5.0.0-rc.10, if you use 5.0.0-rc.9 it does not happen (same firebase version "firebase": "^5.0.4" for both cases).
Doing a console.log of "firebase_app__WEBPACK_IMPORTED_MODULE_1__" shows:
|
I'll check on this + put in an SSR test to make sure we don't regress in future releases. |
Any solution to this yet? |
@ericel As a workaround you can use version 5.0.0-rc.9
|
I am actually using that! But am still getting the error.
|
Fixed in rc.11 |
Same here. I still get this issue.
|
I am still getting this error. @jamesdaniels. But it is working for me in rc.9 |
I'm still getting the |
Hello, I am now getting the error myself when I try to build my Here is the complete and boring console log of the error step by step: Thanks! |
Why was this closed? This is still an occurring issue in RC.11. Using my own node server I still get this error. Any help or direction to a workaround or anything would be greatly appreciated. Thanks! |
@jwuliger Can you try removing |
@gayankalhara Hello! Thanks for your reply. Yes, I have done that several times. I have tried Yarn and NPM, clearing cache and all that fun stuff. Just when I think I have found the issue, it reveals itself again in a different form. This must be something I am not configuring correctly. However I have done this several time before without issue. If I share my |
Using rc.11 i went to node_modules/angularfire2/firebase.app.module.js |
it is not working yet..Anyone has a solution of it ? |
@yugank1991 did you try the solution i posted above? Seems to have solved the issue for me. |
@anasbaddyr |
I have tried everything as well. All suggestions including the one from @yugank1991. Prerendering and SSR does not work with Firebase Hosting/Cloud Functions. I can't speak for anyone else but I am also not able to get it to work on my workstation using a simple NodeJS Server. I don't understand why this issue was closed as many people are having problems with it. Is there something that I am missing here? Is there a specific combination of pack |
Update - Found the issue for me. @yugank1991 Your solution was what led me to find out that I needed to add an additional import. Instead of:
I changed the imports to:
Now I can run SSR on any Node server. I am still in the process of testing the firebase function for hosting. If you would like to see this working in real-time check out my Repo here: |
@jwuliger unfortunately this is not working for me. Thanks |
Hello @alexdabast Judging from what is working for others in this issue, my best guess is that it must be environment/package related. I am not currently using Firebase Messaging. My issue was using Firebase with AngularFire2 in dynamic SSR and/or generative prerendering with Angular Universal. My environment is:
Also from my last comment, you can pull the app I am working on in question from my public repository here: https://github.com/jwuliger/personal-website As for why I need to import Firebase that way into AngularFire2 - well not 100% sure. My best guess is all the typing changes in vanilla Firebase. My work-around to patch AngularFire2 came from how the lib There is an Angular v6 Branch you can check out here that also includes Firebase Messaging: https://github.com/hamedbaatour/angularfire-lite/tree/v6.0 I hope that this helps and be sure to checkout my repo to see AngularFire2 & Angular Universal working. Next goal is to be able to run my node server from a cloud function whenever they fix that. Thanks |
Thank you I made it work by downgrading to angularfire2 to rc9 so for me I think there is still something wrong in the rc10/11 release |
@alexdabast Yes, that was another solution. I wanted to use the latest RC.11 build though. I am glad you have everything squared away now! |
@jamesdaniels i'm getting this error with rc.11 as well any chance you could look into it again? See above for others with the same issue |
**Still the error comes in 5.0.0-rc.11 ** |
@jamesdaniels
|
Fixed it with "angularfire2": "^5.0.0-rc.9", but then I got this error from my prerenderer
I fixed this by adding these 2 lines from server.ts also in prerender.ts
|
Also important is to call For prerendering with firebase there is a great article here: |
I get this error using rc9 and rx11! I fixed it by using @jwuliger's fix. |
so what is the last decision? which versions of angularfire and firebase solves problem? or how to import firebase? still i got the error TypeError: Cannot read property 'filter' of undefined at _firebaseAppFactory |
Got everything to work using: |
still not working, now error switched to that one -_- : i followed @philip-firstorder but again not working after all - p.s ng serve works fine, SSR not working |
Same problem here... |
@gfaganli Here is my project for you to do a side-by-side comparison with yours, maybe it helps. Mine compiles for ssr, prerender, serve, everything... |
Fixing the apps/filter issue in #1821 |
Thanks @jamesdaniels! Universal doesn't throw that error with rc12 anymore. The XMLHttpRequest fix mentioned by @philip-firstorder is still required which is simple enough. |
Is latest version compatible with angular 5? I am using firebase in 2 project, one app is in the angular 5, another angular 6. Angular 6 works fine with "angularfire2": "^5.0.0-rc.12", "firebase": "^5.4.1". But in angular 5 it throws an error like - try { |
Check these and see if it solves your issue: |
@kamshak Thanks for your help. |
Hi Team,
I am new in AngularFire2 library. I am getting one issue while making ssr build only. If i am running ng run build:ssr then i am getting some warnings.
WARNING in ./node_modules/angularfire2/firebase.app.module.js
15:22-26 "export 'apps' was not found in 'firebase/app'
@ ./node_modules/angularfire2/firebase.app.module.js
@ ./node_modules/angularfire2/public_api.js
@ ./node_modules/angularfire2/index.js
@ ./dist/server/main.js
@ ./server.ts
WARNING in ./node_modules/angularfire2/firebase.app.module.js
16:27-40 "export 'initializeApp' was not found in 'firebase/app'
@ ./node_modules/angularfire2/firebase.app.module.js
@ ./node_modules/angularfire2/public_api.js
@ ./node_modules/angularfire2/index.js
@ ./dist/server/main.js
@ ./server.ts
But after running npm run serve:ssr, i am getting this error
TypeError: Cannot read property 'filter' of undefined
at _firebaseAppFactory (E:\dev\migration\dist\server.js:206291:73)
at E:\dev\migration\dist\server.js:210811:95
at ZoneDelegate.invoke (E:\dev\migration\dist\server.js:527:26)
at Zone.run (E:\dev\migration\dist\server.js:277:43)
at NgZone.runOutsideAngular (E:\dev\migration\dist\server.js:7898:28)
at new AngularFireAuth (E:\dev\migration\dist\server.js:210810:26)
at _createClass (E:\dev\migration\dist\server.js:13149:20)
at _createProviderInstance$1 (E:\dev\migration\dist\server.js:13111:26)
at resolveNgModuleDep (E:\dev\migration\dist\server.js:13077:21)
at _createClass (E:\dev\migration\dist\server.js:13143:107)
Because of this error i am unable to migrate from Angular 5 to Angular 6. Please help
The text was updated successfully, but these errors were encountered: