Skip to content
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

core-js 3.6.0 causes angular downloads to timeout in IE11 #754

Closed
jahumes opened this issue Jan 20, 2020 · 8 comments
Closed

core-js 3.6.0 causes angular downloads to timeout in IE11 #754

jahumes opened this issue Jan 20, 2020 · 8 comments

Comments

@jahumes
Copy link

jahumes commented Jan 20, 2020

We are having an issue (see angular/angular-cli#16715) in our codebase where an update to the @angular-devkit/build-angular package that just updates the version of core-js from 3.3.6 to 3.6.0 causes the download of certain files to never stop downloading in IE11.

Any build that includes this commit (80d7bfe) 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.

This problem exists in all versions 3.6.x.

Please let me know what else I can do to explore how this could be affecting the build and/or any questions you have for me about this.

@jahumes jahumes changed the title core-js 3.6.0 causes angular builds to fail in IE11 core-js 3.6.0 causes angular downloads to timeout in IE11 Jan 20, 2020
@jahumes
Copy link
Author

jahumes commented Jan 27, 2020

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.

@jahumes
Copy link
Author

jahumes commented Jan 27, 2020

I would totally do a pull request, but I am not an expert enough on what that commit does to regex to understand why it would suddenly break everything.

@andymac
Copy link

andymac commented Jan 31, 2020

Confirming similar behavior in a React app after upgrading to 3.6.1 - we had to downgrade to get our app to load in IE 11. Same "long running script error" as above.

Also, happy to patch with a PR but also not clear what this commit does to regex

@underbyte
Copy link

Made a simplify repo that has just webpack@4 + core-js@3.6.4 + xregexp@4.3.0; link here. IE will go into an infinite loop as soon as core-js/regexp and xregexp are loaded. The issue seems to be with core-js/features/regexp at this line. Only in IE will it return an empty array. All of this bubbles up to this line in xregexp that causes the infinite loop because token.length is zero when it gets assign to pos.

Captured this screenshot in regexp-exec where match shouldn't have an empty array.
regexp sticky bug

@cvle I'm not much of an expert when regex sticky. Any idea what can be causing this?

@x2764tech
Copy link

Think this is related to alternatives in RegExp:

Test case 1: no alternatives (passes)

> let test = new RegExp("\\{([a-z]+)\\}", "yi");
/{([a-z]+)}/iy
> test.exec('{YYYY}')
["{YYYY}", "YYYY"]
> test.exec('{YYYY}')
null

Test 2 case: alternatives (fails)

> let test = new RegExp("\{([a-z]+)\}|[^\{]","yi")
/{([a-z]+)}|[^{]/iy
> test.exec('{YYYY}')
["{YYYY}", "YYYY"]
> test.exec('{YYYY}')
["", undefined]
> test.exec('{YYYY}')
["", undefined]

@x2764tech
Copy link

Was introduced by #732

x2764tech added a commit to x2764tech/core-js that referenced this issue Mar 3, 2020
@Sunilaj
Copy link

Sunilaj commented Apr 29, 2020

When is this planned to be addressed? We use core-js and are significantly impacted by this in one of our scenarios.

@zloirock
Copy link
Owner

zloirock commented Nov 5, 2020

Let's track it here #810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants