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

Add fatal flag to TextDecoder to fix inconsistency #119

Closed
wants to merge 1 commit into from

Conversation

etodanik
Copy link

The purpose of this PR is:

Fix inconsistency between fetch-blob and the browser File behavior.
#118

This is what had to change:

Make invalid utf-8 decoding non fatal

@jimmywarting
Copy link
Contributor

the default value is false. so is this really necessary?

@etodanik
Copy link
Author

Yes , it didn't work for me without it.

@jimmywarting
Copy link
Contributor

weird, is there some node version you are using that throws an error and use fatal=true?

i tried node 16 and executed new TextDecoder().decode(Uint8Array.from([_issue_118_])) and i did not get any error.

@etodanik
Copy link
Author

etodanik commented Oct 26, 2021

Not node, specifically the polyfill that Next.js uses (and next.js is quite widespread. Enough to set an explicit default IMHO)

@jimmywarting
Copy link
Contributor

Not node, specifically the polyfill that Next.js uses

Oh, well... that ain't good. I would like to follow up on the polyfill that next.js uses and report to them that they have a buggy implementation of TextDecoder

@jimmywarting
Copy link
Contributor

Going to close this b/c there is something wrong on Next.js part - not ours
The pressure should be on them to fix it.

What you could do is freaze the global TextDecoder so it can't be overwritten when there is already something working without a polyfill

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

Successfully merging this pull request may close these issues.

None yet

2 participants