Skip to content

IE11 + core-js@3.6.4 String.prototype.split doesn't work with regexp #751

Closed
@kmsheng

Description

@kmsheng

Screen Shot 2020-01-15 at 9 40 26 PM

repo to reproduce
https://github.com/kmsheng/core-js-bug

Note that core-js was imported twice,
one in src/js/index.js and the other one in assets/js/default.js

simlar issue
#741

Activity

jaynetics

jaynetics commented on Jan 17, 2020

@jaynetics

i encountered the same bug, and can confirm that importing core-js into two js files is the root cause. importing it in only one file fixes the problem.

11101101

11101101 commented on Feb 10, 2020

@11101101

I'm also running into the same issue. My code path results in a second import which causes the bug to manifest.

pierremanceaux

pierremanceaux commented on Feb 12, 2020

@pierremanceaux

In case this helps someone: JakeChampion/fetch#748
It would be great to identify which version of IE11 is/are affected, but it seems pretty recent to me, probably the last build.

aliaksandr-yermalayeu

aliaksandr-yermalayeu commented on Feb 27, 2020

@aliaksandr-yermalayeu

Hi everyone. I am facing the same issue. It is still reproduced in IE11 with the latest version of core-js. However the scenario is pretty tricky to reproduce. So I created a minimal repo with needed steps. Hope it helps.

sargismarkosyan

sargismarkosyan commented on Mar 5, 2020

@sargismarkosyan

Hi, the issue is reproducible with other regexp too for example '/test/'.split(/\W/) is returning ["/", "t", "e", "s", "t", "/"] but should return ["", "test", ""].

slowcheetah

slowcheetah commented on Mar 27, 2020

@slowcheetah
Collaborator

Please show your npm list | grep core-js

aliaksandr-yermalayeu

aliaksandr-yermalayeu commented on Apr 2, 2020

@aliaksandr-yermalayeu

@slowcheetah, will result of yarn list --pattern core-js work for you?

├─ core-js-compat@3.6.4
└─ core-js@3.6.4
aliaksandr-yermalayeu

aliaksandr-yermalayeu commented on Apr 7, 2020

@aliaksandr-yermalayeu

I took a deeper dive into this issue. The problem is caused by this line. It turns out regexp.exec and regexpExec are different references when polyfill is loaded twice.

steveworkman

steveworkman commented on Apr 23, 2020

@steveworkman

Is there an older version of core-js that does not show this issue? It looks like there were changes related to adding more regexp.exec requires in 3.6.2
Would a downgrade to 3.6.1 work?

jdreesen

jdreesen commented on Apr 23, 2020

@jdreesen
Contributor

I downgraded to 3.5.0 yesterday and it works for me.

aliaksandr-yermalayeu

aliaksandr-yermalayeu commented on Apr 23, 2020

@aliaksandr-yermalayeu

The bug was introduced by version 3.6.0 due to support of y flag. In version 3.5.0 exec was never patched in IE.

23 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @toxik@jdreesen@Jokero@kmsheng@steveworkman

      Issue actions

        IE11 + core-js@3.6.4 String.prototype.split doesn't work with regexp · Issue #751 · zloirock/core-js