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

node-compat: Missing import { isBuiltin } from "node:module"; #22502

Closed
birkskyum opened this issue Feb 20, 2024 · 3 comments · Fixed by #22817
Closed

node-compat: Missing import { isBuiltin } from "node:module"; #22502

birkskyum opened this issue Feb 20, 2024 · 3 comments · Fixed by #22817
Assignees
Labels
bug Something isn't working correctly good first issue Good for newcomers node API polyfill Related to various "node:*" modules APIs node compat

Comments

@birkskyum
Copy link
Contributor

birkskyum commented Feb 20, 2024

Version: Deno 1.40.5

I tried running an example of vinxi, and got this:

[11:21:44 PM]  ERROR  The requested module 'node:module' does not provide an export named 'isBuiltin' at file:///Users/admin/repos/vinxi/examples/solid/spa/basic/node_modules/.deno/vinxi@0.3.3/node_modules/vinxi/lib/manifest/collect-styles.js:3:10

  at async Object.run (node_modules/.deno/vinxi@0.3.3/node_modules/vinxi/bin/cli.mjs:158:33)
  at async runCommand (node_modules/.deno/vinxi@0.3.3/node_modules/citty/dist/index.mjs:316:16)
  at async runCommand (node_modules/.deno/vinxi@0.3.3/node_modules/citty/dist/index.mjs:307:11)
  at async runMain (node_modules/.deno/vinxi@0.3.3/node_modules/citty/dist/index.mjs:445:7) 

Related to:

@bartlomieju bartlomieju added bug Something isn't working correctly good first issue Good for newcomers node compat labels Feb 20, 2024
@Farsen976
Copy link
Contributor

Hey 👋,
I'd like to tackle this task, in which file should I define the missing import?

@bartlomieju
Copy link
Member

@Farsen976 you need to add it to ext/node/polyfills/01_require.js. You'll need to add a isBuiltin function that will check if the module is available in nativeModuleExports object.

Farsen976 added a commit to Farsen976/deno that referenced this issue Feb 21, 2024
@bartlomieju bartlomieju added the node API polyfill Related to various "node:*" modules APIs label Mar 4, 2024
@dsherret
Copy link
Member

dsherret commented Mar 5, 2024

@Farsen976 it looks like you did a commit for this? Would you be able to open a PR with that commit? (Ideally with a test too)

nathanwhit added a commit that referenced this issue Mar 14, 2024
Fixes #22502

Implements the
[`isBuiltin`](https://nodejs.org/api/module.html#moduleisbuiltinmodulename)
function in `node:module`. I had to update the version of `@types/node`
in the test registry in order to get the test I added to typecheck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly good first issue Good for newcomers node API polyfill Related to various "node:*" modules APIs node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants