Skip to content

Being able to do import(blobUrls) #47573

Open
@jimmywarting

Description

@jimmywarting

What is the problem this feature will solve?

tried doing:

code = 'console.log("hi")'
blob = new Blob([code], { type: 'text/javascript' })
url = URL.createObjectURL(blob)
import(url)

but failed with:

Only URLs with a scheme in: file and data are supported by the default ESM loader. Received protocol 'blob:'

What is the feature you are proposing to solve the problem?

being able to import dynamic generated code...

What alternatives have you considered?

converting it to a data: url works as a work around...

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedPRs that are blocked by other issues or PRs.esmIssues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions