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

consider using node: import prefixes #31

Open
joprice opened this issue Jun 29, 2024 · 1 comment
Open

consider using node: import prefixes #31

joprice opened this issue Jun 29, 2024 · 1 comment

Comments

@joprice
Copy link

joprice commented Jun 29, 2024

When attempting to run some code making use of the fs builtin via deno, I get the error

error: Relative import path "fs" not prefixed with / or ./ or ../
If you want to use a built-in Node module, add a "node:" prefix (ex. "node:fs").

Versions of since 16 and >= 14.18 have support for prefixed builtins https://nodejs.org/api/modules.html#built-in-modules, so there is a compatibility concern.

You can work around this with deno (and possibly something similar for bun) by using import maps or --unstable-bare-node-builtins, but it is also mentioned in the Node docs using the prefixes has the benefit of avoiding another module of the same name unintentionally shadowing the builtin.

@MangelMaxime
Copy link
Member

I think this addition will be done later in the Glutinum rewrite of this package this is so we are sure to not break anything in this package.

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

No branches or pull requests

2 participants