angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.73k stars 11.98k forks source link

RC8 Breaks Hybrid App in IE11 Because of Upgrade to core-js 3.6.0 in @angular-devkit/build-angular #16715

Closed jahumes closed 4 years ago

jahumes commented 4 years ago

🐞 Bug report

Command (mark with an x)

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.0.0-RC7 ### Description We are having an issue in IE11 where the download of the vendor.js and main.js files during a `ng build` or `ng serve` never completes. It shows a pending forever in the network tab and we theorize that this is because it is getting some kind of parsing error. We first tracked it down to the @angular-dev-kit/build-angular and then to this commit (https://github.com/angular/angular-cli/commit/6ffa74acead4798a42f82b4a3001fec26625d738) which upgraded core-js 3.3.6 to 3.6.0 to the build-angular dependencies. Any build after this one (https://github.com/angular/angular-devkit-build-angular-builds/commit/cbd21fa9307631006689f42f2afeb986f5c4f5be) fails to load in IE11 with either a never ending spinner or a long running script error. No other errors ever present themselves in the console. For any build after the one listed above, if you go into the `node_modules/@angular-devkit/build-angular/node_modules` and delete the `core-js` folder, then node will revert to the project `core-js` folder (we can verify it works at 3.1.4, 3.3.6, and 3.5.0) and everything works just fine. We have tested this with the most recent commits/builds and this is still an issue with 3.6.4 of core-js. ## πŸ”¬ Minimal Reproduction

This is super hard to reproduce because we are running an AngularJS and Angular hybrid app with over half a million lines of code. We are not sure what in our build process is causing the issue but it is for sure being caused by the upgrade to version 3.6.x of core-js. We are very happy to do any kind of screen share or provide more information if that is required.

We are attempting to make a project that makes this reproducable

πŸ”₯ Exception or Error

The only error is sometimes it errors with "...not responding due to a long running script"

🌍 Your Environment


Angular CLI: 9.0.0-rc.9
Node: 12.13.0
OS: darwin x64

Angular: 9.0.0-rc.9
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker, upgrade
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.9
@angular-devkit/build-angular     0.900.0-rc.9
@angular-devkit/build-optimizer   0.900.0-rc.9
@angular-devkit/build-webpack     0.900.0-rc.9
@angular-devkit/core              9.0.0-rc.9
@angular-devkit/schematics        9.0.0-rc.9
@angular/cdk                      9.0.0-rc.8
@ngtools/webpack                  9.0.0-rc.9
@schematics/angular               9.0.0-rc.9
@schematics/update                0.900.0-rc.9
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.41.5

Anything else relevant?

Only in IE11

One last comment, changing dependency versions seems like the kind of thing that shouldn't be done in a release candidate except when fixing a specific bug.

jahumes commented 4 years ago

It appears to be this commit from core-js (https://github.com/zloirock/core-js/commit/80d7bfee5e5974f4e5c591c80b0aff8362daf4e1). I am not sure exactly how this would affect the build for IE11 and causing this issue unless there is something about the output that includes RegEx. I have tested core-js builds both before and after this commit.

clydin commented 4 years ago

If you have some time, can you provide some additional details regarding how polyfills are used within the project? For instance, are their multiple versions of core-js involved? Is core-js being used as a project dependency? Is core-js being used by application code outside the automatic inclusion by the CLI? If so, what parts of core-js and how are they loaded/used? Are any other polyfills being used? Also, can you provide the version of zone.js in use by the application?

jahumes commented 4 years ago

@clydin I have tracked down my specific issue to the inclusion of of xregexp with the most recent version of core-js (3.6.4). You can download a project with this issue by going here https://github.com/jahumes/angular9-core-js-xregexp. It seems that the polyfill for sticky regex causes an infinite loop when being parsed by IE11.

I would ask that, because Angular-CLI doesn't allow us to choose the version of core-js anymore (polyfills-es5.ts), the version of core-js be downgraded to what it was before unless there is a specific reason for changing to a different version than the one the main Angular project uses.

alan-agius4 commented 4 years ago

Hi, this should be fixed in RC 12, can you please confirm?

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.