The Wayback Machine - https://web.archive.org/web/20201212073336/https://github.com/github/fetch/issues/748
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
Closed

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

pierremanceaux opened this issue Jan 16, 2020 · 16 comments

Comments

@pierremanceaux
Copy link

@pierremanceaux 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
Member

@dgraham 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 Jan 24, 2020
@pierremanceaux
Copy link
Author

@pierremanceaux pierremanceaux commented Jan 24, 2020

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

@charlesbjohnson charlesbjohnson commented Feb 12, 2020

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

screenshot

@pierremanceaux
Copy link
Author

@pierremanceaux 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 charlesbjohnson 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?

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 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

@pierremanceaux pierremanceaux commented Feb 12, 2020

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:

  • Well, I expect Browserstack to keep things up to date
  • All google results are from end of last year until now
  • Also just found a similar issue here: zloirock/core-js#751

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

@ansbar
Copy link

@ansbar 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

@pierremanceaux pierremanceaux commented Feb 21, 2020

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

@pierremanceaux
Copy link
Author

@pierremanceaux pierremanceaux commented Feb 21, 2020

@dgraham maybe we should re-open this issue?

@ansbar
Copy link

@ansbar 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 was marked as spam.

nutgaard added a commit to navikt/modiapersonoversikt that referenced this issue Jun 9, 2020
Gjøres pga følgende issues;
github/fetch#750
github/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

@steveworkman steveworkman commented Sep 18, 2020

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
Collaborator

@JakeChampion JakeChampion commented Sep 18, 2020

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

@steveworkman steveworkman commented Sep 18, 2020

@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
Collaborator

@JakeChampion JakeChampion commented Sep 18, 2020

@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 👍

steveworkman added a commit to steveworkman/fetch that referenced this issue Oct 9, 2020
JakeChampion added a commit that referenced this issue Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
7 participants
You can’t perform that action at this time.