-
Notifications
You must be signed in to change notification settings - Fork 12k
Cli 8.3.0 ES5 build browser errors (Unable to get property 'enumerable' of undefined or null) #15436
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
Not sure if it will help but these are the build files for es5 polyfills from both versions |
This appears to be a bug but we will need to look at a reproduction to find and fix the problem. Can you setup a minimal reproduction please? You can read here why this is needed. A good way to make a minimal reproduction is to create a new app via |
@clydin I am try to put together a reproduction, but it's not proving to be easy. I have found that if I turn off optimization on the build I don't get the errors, so look like something is getting messed up during that process. |
@clydin I've updated the gists of the polyfills generated by each so that they are not optimized and there are no similarities between the 2 so there seems to have been a major change to how the polyfills are created. 8.2.2 |
I have the same problem from 8.3.0. I don't know if this is relevant, but with v8.2,
Now, it's just :
|
Our team is unfortunately also experiencing this problem with the CLI in version
If I somehow can help fix this issue, let me know. |
Exactly same error for me in IE11. Also affects an application with lazy loading, but I don't know if this is relevant. |
@dottodot and @mpalourdio the changes that you are seeing in the polyfills and console respectively are expected, this is because in 8.3 we no longer generate the ES5 bundles using a separate Webpack build. But rather we use babel to downlevel the ES2015 code to ES5. As @clydin mentioned, it would be useful and helpful for us to track down the problem if someone puts together a minimal reproduction. |
Are any of these projects public? Without a way to reproduce the problem, it is quite difficult to troubleshoot or provide a solution. The configuration options for the project from both Also, please ensure that the |
@clydin I have started the process of trying to reproduce the issue 👨🏻🦳 |
@clydin My failing projects are both private, I need time to make a reproducible public one. For the moment, here are few answers
Hope this helps a bit for the moment ! Thanks for taking time to take a look at this ! |
@clydin I'm using dynamic imports for my lazy modules, one thing I've noticed is I'm only getting the error when I click on a link in the app (via routerLink). If I access the route directly the modules loads without any errors. I updated to the latest version of core-js but that has not made any difference. This is my browserlist
|
Thank you for the information. Two additional items that can be tried are the following:
These should both be considered workarounds but they also have value in aiding to narrow down the root cause of the issue. Please let me know if either or both of these options prevent the issue from occuring. |
It also seems like the |
@dottodot Does this occur with every lazy module accessed via a Is there any stack trace information that goes along with those errors? |
I have same error in IE11. Angular CLI: 8.3.0 Package Version@angular-devkit/architect 0.803.0 I have only lazy modules. |
Just an FYI - Setting the NG_BUILD_DIFFERENTIAL_FULL environment variable to 1 got rid of the error for me. |
Yes, it's helped. |
Hi all, I have tried to replicate the above reported issue but I was unable to do so. Steps
Added the below in
Opened the page in Result We really need a reproduction to track down and solve the issue. |
@alan-agius4 I have a hard time trying to reproduce this in a minimal project too. But the problem exists. Can you just try adding a guard that returns an One of my project has |
Ok, so I have tried with both the guard and the polyfill, with no luck as this runs okish in IE11 |
@alan-agius4 Do you need to make the code run ? As it's tightly coupled with a java backend and some node_modules published internally on a 'nexus', it can be very difficult. Otherwise I have no problem with sharing the project privately |
Yeah, it would need to "run" to see the error in the browser. If you share the dist folder alone will I be able to see the mentioned error? |
Let me give this a try with the dist folder. @alan-agius4 mail sent from my corporate email@ (Sent at 15:02 GMT+2). |
I had
only working solution was to downgrade to
browserlist did not help nor adding all polyfills by hand to polyfill.ts edit: NG_BUILD_DIFFERENTIAL_FULL=1 works too |
@alan-agius4 Sorry for spamming here, please delete once notified, but gmail antivirus rejected my mail. I have invited you in a private repo : https://github.com/mpalourdio/ngcli830-dist |
@mpalourdio, can you also provide the unminified version of the code please? Thanks |
@alan-agius4 added in a zip on the repo |
I updated using ng update and boom got this warning WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 82.5 kB. Generating ES5 bundles for differential loading... ES5 bundle generation complete. bundle.js is now 1.5mb with 8.2.2 it wasn't that big in size. |
thanks @mpalourdio |
We had |
on CLI 8.3.1, When we use NGRX, Will have the 'regeneratorRuntime' is undefined issue in IE 11..... |
Setting the NG_BUILD_DIFFERENTIAL_FULL environment variable to 1 also got rid of the error for me. |
This is probably caused by #15246 as when I searched for what caused our issue, I found https://babeljs.io/docs/en/babel-polyfill where the I did an upgrade on our projects again to provide more info. Our larger app
Our smaller app
So 2 apps, same (nx) project, similar setup, different error messages in IE 11. |
@alan-agius4 I updated the |
@merobal, the first issue you are experiencing is not related to this one. With regards to the For the second issue make sure that you delete the cache prior to rebuilding after changing the code in build-angular using:
Can you check if you still get the 2nd error after that? |
@alan-agius4 Thanks for pointing out that PR. About the second issue: thanks for suggesting to remove the cache, I can confirm that our smaller app works good now. I re-tested our larger app with adding the missing polyfill manually (and having the build fix), and that works now too. |
Thanks @merobal for checking |
A huge thanks goes to @mpalourdio for providing a reproduction that was crucial to pinpoint the issue. |
Hey, happy to help and happy to see that this issue has been resolved ! You all do an AWESOME job here! |
…nction name mangling Disables toplevel mangling and enables compression for es5 bundles. With compress enabled we reduce a further ~7Kb Closes: #15436
…nction name mangling Disables toplevel mangling and enables compression for es5 bundles. With compress enabled we reduce a further ~7Kb Closes: #15436
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: ....In version 8.2.2 I have no issues
Description
After updating to cli 8.3.0 I suddenly noticed a load of different errors for browsers using the es5 versions such as
Uncaught (in promise): TypeError: Object prototype may only be an Object or null.
Object prototype may only be an Object or null.
Uncaught (in promise): TypeError: Unable to get property 'enumerable' of undefined or null reference
These errors seem to be occuring when loading lazy modules via the router, and the module will not load, but not all modules have an issue.
🔬 Minimal Reproduction
So far I've not been able to find the cause, the project it's happening on is pretty big so could take an age to narrow it down, all I know so far is everything works without issue when using 8.2.2.
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: