Skip to content

universal prerendering fails with: import 'firebase/firestore' #2350

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

Closed
GrandSchtroumpf opened this issue Mar 10, 2020 · 1 comment
Closed

Comments

@GrandSchtroumpf
Copy link

GrandSchtroumpf commented Mar 10, 2020

Version info

Angular: 9.0.0
Firebase: 7.10.0
AngularFire: 6.0.0-rc.1

How to reproduce these conditions

  • Create an angular app: ng new prerender-test
  • Add @angular/fire with schematics : ng add @angular/fire
  • Add angular universal : ng add @nguniversal/express-engine
  • Add import 'firebase/firestore'; in app.component
  • Run npm run prerender

Debug output

** Errors in the JavaScript console **

** Output from firebase.database().enableLogging(true); **

WARNING in ./node_modules/grpc/src/grpc_extension.js 32:12-33
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js 20:22-48
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js 17:20-67
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/bytebuffer/dist/bytebuffer-node.js
Module not found: Error: Can't resolve 'memcpy' in './node_modules/bytebuffer/dist'

Prerendering 1 route(s) to /path/to/prerender-test/dist/browser
(node:3430) UnhandledPromiseRejectionWarning: Error: package.json does not exist at /path/to/prerender-test/dist/package.json

Expected behavior

Prerender should not fail.

Actual behavior

It fails

@jamesdaniels
Copy link
Member

Addressing in #2347. Discussion here #2320. Work-arounds detailed in the comments. TLDR add @firebase/firestore to externalDependencies in your angular.json and I will cut the other fixes in the next RC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants