Closed chrisoppedal closed 3 years ago
If you’re importing it without a binding, you need to import globalthis/auto
. The /polyfill entrypoint is a function that if you don’t use, it does nothing.
Hey thanks for the response. I'm still getting this error in the logs for my firebase 'ssr' function:
Provided module can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: ReferenceError: globalThis is not defined
at Object.
My Angular Universal app was deploying fine before adding AngularFire(https://stackoverflow.com/questions/65243054/cant-update-firebase-function-to-node-12-in-angular-universal-app-with-angularf). This is my polyfill.ts file:
import 'zone.js/dist/zone'; // Included with Angular CLI. import 'globalthis/auto';
You'll want to import globalThis first, since it's a polyfill; beyond that, i'm not sure why it wouldn't be working.
I was importing it in polyfill.st. To get it to deploy in the firebase node environment I added the following to server.ts: import 'globalthis/auto';
I tried the implementation in the documentation in my polyfill.ts but I'm still getting the error: globalThis is not defined. The polyfill.ts file didn't like using the require keyword so I implemented it like the other Angular polyfills: import 'globalthis/polyfill';
Is there a separate implementation for Angular 11 apps running in node 10?