-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Hangs when loading module in IE11 - with core-js 3.6.0 or newer, with and without babel sticky-regex polyfill #300
Comments
I reproduced the error in IE11 also with an empty next.js project with and without regex sticky polyfills by just adding To disable the default polyfill, I used this .babelrc
This is the loop that never exits because token is an empty string: |
@slevithan is this something you could take a look at? I don’t quite grasp the purpose of the code that hangs |
@josephfrazier any chance you could take a peek? |
@perbergland The line of code you highlighted is just concatenating two different regexes together, and separating them with an “or” ( Some potential fixes and workarounds:
const subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g;
const parts = /\({{([\w$]+)}}\)|{{([\w$]+)}}|(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g; |
Not sure I understand what you mean, but I ended up removing the dependency on xregexp from my app to fix the IE incompatibility. Feel free to close the issue, I don't care anymore. |
@perbergland just wanna let you know this issue is totally ruining my day right now. You're not alone 😅 IE11 hangs and is completely broken just by including this library as stated. |
I've starting looking into this. Thanks for the repro repo @perbergland. So far I've learned the issue in IE11 is not being triggered by the identified line per se. It is any invocation of the |
I've added a fix for this in bece2eb
That was indeed the problem. The core-js 3.6.0 sticky polyfill appears to be partially broken or incomplete. I've added a check for incorrect handling of sticky, and made XRegExp treat the |
Fix published in v4.4.0. |
v 4.3.0
With core-js 3.6.0 (and newer up to 3.6.5), when loading the module, the call to
const parts = XRegExp.union
hangs and never returns. core-js 3.6.0 introduced new compatibility stuff for sticky so maybe that’s the core problem?xregexp/src/addons/build.js
Line 10 in 95eeebe
The text was updated successfully, but these errors were encountered: