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

Add Synthetic Module Resolver for Node.js Built-in Modules #283

Closed
2 tasks done
caoccao opened this issue Nov 4, 2023 · 0 comments · Fixed by #284
Closed
2 tasks done

Add Synthetic Module Resolver for Node.js Built-in Modules #283

caoccao opened this issue Nov 4, 2023 · 0 comments · Fixed by #284
Assignees
Labels
enhancement New feature or request

Comments

@caoccao
Copy link
Owner

caoccao commented Nov 4, 2023

Background

The Node.js module resolution callback doesn't allow the embedder to relay the calls as a default callback. If the embedder sets its own callback, the Node.js built-in modules will not be reachable any more. Please refer to this issue for more details.

Solution

  • Implement synthetic module in Add createV8Module() to V8Runtime #282.
  • Create a dedicated module resolver that calls require('node:module-name') and exports the return object as a synthetic module.
@caoccao caoccao self-assigned this Nov 4, 2023
@caoccao caoccao added the enhancement New feature or request label Nov 4, 2023
@caoccao caoccao linked a pull request Nov 7, 2023 that will close this issue
@caoccao caoccao closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant