-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Trouble bundling Firestore for Universal (ENOENT / app.firestore not a function) #2686
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
Comments
Checkout what I've done in my sample app to support this https://github.com/angular/angularfire/blob/master/sample/server.ts#L18. I used I'm considering what an official happy path here with the schematic might look like. |
Closing but pinning, since this isn't strictly AngularFire issue and there's a work-around. |
Another solution FWIW is to add all the firebase and |
@jamesdaniels please help me whate can i do wrong
and this works as fine, yes? Afer build: I found file with undifined name without extentions. Start with this code: After when i started the server
|
I'm guessing your paths need to be altered in the firestore_protos.ts, this is a very new solution. The other as mentioned is to put every firebase dep in external 🤷♂ |
firestore_protos.ts file, i dont found any typo:
Are you saying I restore everything and use it as external dep? |
When i add this to externalDependencies |
I had the same issue, and this solves the problem, the other solutions above only introduced more errors for me. Thank you!! |
Can anyone get the sample app to build? I hit an error:
|
Version info
Angular: 10@latest & 11@latest - same result
Firebase: 8.1.1
AngularFire: 6.1.1
Node: 12
Was all working fine on Firebase with SSR setup following the angularfire Guide.
We upgraded Firebase JS SDK and in order to get SSR working again, we had to remove the following from
angular.json
:Hence the error
TypeError: app.firestore is not a function
disappeared and SSR was working again, except on a sub-page that actually tries to load from data from firestore. When rendering this through SSR, we got the error:Expected behavior
Get SSR working with Firestore.
Actual behavior
I can choose a halfway working SSR solution by removing
externalDependencies
inangular.json
(server) that seems to render some of the pages or breaking with missing Proto-Buffer stuff.Or break SSR entirely with the
TypeError: app.firestore is not a function
when having@firebase/firestore
inexternalDependencies
inangular.json
.The text was updated successfully, but these errors were encountered: