-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Blob constructor error message when passing a string is misleading #38856
Comments
Oh looks like this is intentionally not supported Line 106 in 7919ced
|
Can we add a reason why to the docs? |
Here's my interpretation of why a string is not accepted: The specs dictates that the param must be a Now I agree the error message is misleading, for reference here's the error messages thrown by some browsers:
|
This works just fine, however: |
@Ethan-Arrowood ... just as a heads up since you're using |
Yes I saw that, very excited for it. I'm using this in undici-fetch and it'll be a nice perf boost if blob can support the async iterator sources directly 😄 |
resolve: nodejs#38856 PR-URL: nodejs#42338 Fixes: nodejs#38856 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
resolve: nodejs#38856 PR-URL: nodejs#42338 Fixes: nodejs#38856 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
resolve: nodejs/node#38856 PR-URL: nodejs/node#42338 Fixes: nodejs/node#38856 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Is your feature request related to a problem? Please describe.
Working with the new Blob api. Cannot instantiate using a string though I don't see why not.
Describe the solution you'd like
Maybe I'm misunderstanding, but I think strings to implement [Symbol.iterator]; does that not make it an instance of Iterable?
Describe alternatives you've considered
Plenty of work arounds - think this would make for a good addition.
Happy to contribute this feature too
The text was updated successfully, but these errors were encountered: