build error with Angular 8.0.0 (TypeError: Cannot read property 'Promise' of undefined)
See original GitHub issueI 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)
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:
- Created 4 years ago
- Reactions:9
- Comments:16 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same for me as well
However following workaround works.
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