question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build error with Angular 8.0.0 (TypeError: Cannot read property 'Promise' of undefined)

See original GitHub issue

I updated my project to the latest Angular 8.0.0, @angular/fire 5.2.0-rc.1, firebase 6.1.0, firebaseui 4.0.0, firebaseui-angular 3.4.2.

ng serve works well. With ng build or ng build --prod, the build succeeds but I get a console error.

Uncaught TypeError: Cannot read property 'Promise' of undefined
    at da (npm.js:73)
    at npm.js:74
    at npm.js:425
    at Object../node_modules/firebaseui/dist/npm.js (npm.js:425)
    at __webpack_require__ (bootstrap:78)
    at Module../node_modules/firebaseui-angular/fesm2015/firebaseui-angular.js (firebaseui-angular.js:1)

image

Not sure where the issue is (haven’t yet tried to reproduce on a clean project). It might have to do with the Differential Loading introduced in Angular 8 (of the dialog polyfill). https://blog.angular.io/version-8-of-angular-smaller-bundles-cli-apis-and-alignment-with-the-ecosystem-af0261112a27

Update: Disabling differential loading (by setting "target": "es5" in tsconfig.json), resolves the error.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
PandiyanCoolcommented, Jun 10, 2019

for me locally all works fine just on deploying to firebase hosting gives this error.

Same for me as well

However following workaround works.

If you switch target to “es5” in tsconfig.json (turns off differential loading), and run ng build again, the page loads fine.

4reactions
RaphaelJennicommented, Jun 7, 2019

I created a beta version where the plugin is built with the angular 8 cli. PLease give it a try: npm install firebaseui-angular@4.0.0-beta.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught (in promise): TypeError: Cannot read properties of ...
Angular : ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'forEach').
Read more >
cannot read properties of undefined in angular - You.com
1 Answer. The problem is that as an Input variable, the reminders object is initially undefined until angular has finished initializing the component....
Read more >
Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError - Cannot read property 'then' of undefined is thrown when the caller is expecting a Promise to be returned and instead receives ......
Read more >
Getting Error In fresh downloaded Angular project (code) #7262
Unhandled Promise rejection: Cannot read property 'toLowerCase' of undefined ; Zone: ; Task: Promise.then ; Value: TypeError: Cannot read ...
Read more >
Changelog - Cypress Documentation
Compile errors are now surfaced in the command log during tests for Angular ... Cypress would crash with TypeError: Cannot read property 'length'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found