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

IE 11 vs preProcessedHeaders.split(/\r?\n/) #748

Closed
pierremanceaux opened this issue Jan 16, 2020 · 16 comments · Fixed by #852
Closed

IE 11 vs preProcessedHeaders.split(/\r?\n/) #748

pierremanceaux opened this issue Jan 16, 2020 · 16 comments · Fixed by #852

Comments

@pierremanceaux
Copy link

pierremanceaux commented Jan 16, 2020

Hello devs, and thank you for this great polyfill.

I am facing a strange bug in IE 11 (on Browserstack, no access to and old Windows system).

In short, the behaviour of preProcessedHeaders.split(/\r?\n/).forEach(...) seem to be inconsistent between for instance Chrome's last version (my reference point) and IE11 on Browserstack.

IE 11 -> Incorrect
image

Chrome -> Correct
image

Meaning that the polyfill simply doesn't work for me on IE 11.

If you want to try yourself assuming you have an access to an IE 11 browser:

'preProcessedHeaders'.split(/\r?\n/)
'preProcessedHeaders\n'.split(/\r?\n/)
'preProcessedHeaders\r'.split(/\r?\n/)
'preProcessedHeaders\r\n'.split(/\r?\n/)

Is anyone able to reproduce this?

Thank you for your time in advance.

Note
Polyfill version: 3.0.0
Here is the IE11 build I tested with:
image

@dgraham
Copy link
Contributor

dgraham commented Jan 24, 2020

The regular expression works for me in a newer patch version of IE 11, so this might be a bug in the older version Browserstack seems to be using.

Screen Shot 2020-01-24 at 08 42 49

@dgraham dgraham closed this as completed Jan 24, 2020
@pierremanceaux
Copy link
Author

Thank you for having taken the time to test! More tests from more people are welcome here, as it is nearly impossible to obtain information about IE11 builds market shares.
I will notify Browserstack about it, and if they provide me with any interesting information I'll add it in here for other people.

@charlesbjohnson
Copy link

I'm running into the same thing on the newer version of IE 11 that was posted.

screenshot

@pierremanceaux
Copy link
Author

pierremanceaux commented Feb 12, 2020

@charlesbjohnson your version is exactly the same as mine. Edit: or do you simply confirm that you run into this issue too?

@charlesbjohnson
Copy link

@charlesbjohnson your version is exactly the same as mine. Edit: or do you simply confirm that you run into this issue too?

Confirming that I'm running into this issue on the same version that you posted. I don't know how to confirm if this is the latest IE 11, but I downloaded it today from here.

@charlesbjohnson
Copy link

charlesbjohnson commented Feb 12, 2020

Correction: My version is the same as @dgraham's (here), and not the version @pierremanceaux originally posted in the PR description.

@pierremanceaux
Copy link
Author

Yeah, didn't find a way to confirm the build date either, but for everything I see, seems pretty recent to me, if not the last one. I would bet it is the last one because:

Seems like something is broken in IE11's last build...

@ansbar
Copy link

ansbar commented Feb 21, 2020

@pierremanceaux I use a newer version it seems, see image.

image

Cant reproduce your problem but still have the problem in fetch:

image

@pierremanceaux
Copy link
Author

Interesting @ansbar , so in your version, preProcessedHeaders\r\n'.split(/\r?\n/) would work fine?

@pierremanceaux
Copy link
Author

@dgraham maybe we should re-open this issue?

@ansbar
Copy link

ansbar commented Feb 21, 2020

preProcessedHeaders.split(/\r?\n/) works with your examples but not in my real life test.
For now I use:
preProcessedHeaders.split('\r\n')
which works.

@RamboKBR

This comment has been minimized.

nutgaard added a commit to navikt/modiapersonoversikt that referenced this issue Jun 9, 2020
Gjøres pga følgende issues;
JakeChampion/fetch#750
JakeChampion/fetch#748
zloirock/core-js#751
zloirock/core-js#741

I bunn og grunn, core-js@^3.6.0 introduserte støtte for
String.prototype.split med regex som har sticky-flag. Pga bug her så
fungerer ikke funksjonen som forventet noe mer i eldre IE11 versjoner.

E.g `"test".split(/e/) === ['t', 'e', 's', 't']`, denne burde gitt
`['t', 'st']`
@steveworkman
Copy link
Contributor

The core-js ticket isn't getting any progress right now. Is there a way to work around this issue by not using the polyfilled regex and doing it a different way?

@JakeChampion
Copy link
Owner

This project does not use core-js at all, the issue you are seeing is one from core-js itself I believe and not something in this project.

@steveworkman
Copy link
Contributor

@JakeChampion we do know of the issue though and it's common to use core-js polyfills and this polyfill. If we can use different code that doesn't trigger the bug - surely that's a win?

@JakeChampion
Copy link
Owner

@JakeChampion we do know of the issue though and it's common to use core-js polyfills and this polyfill. If we can use different code that doesn't trigger the bug - surely that's a win?

I'm happy to accept a pull-request for that change 👍

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

Successfully merging a pull request may close this issue.

7 participants