Skip to content

Blob constructor error message when passing a string is misleading #38856

Closed
@Ethan-Arrowood

Description

@Ethan-Arrowood

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.

new Blob('nodejs')

// -> The "sources" argument must be an instance of Iterable. Received type string ('nodejs')

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.errorsIssues and PRs related to JavaScript errors originated in Node.js core.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions