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

support node: prefix in esm build dependencies #15577

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

vankop
Copy link
Member

@vankop vankop commented Mar 23, 2022

What kind of change does this PR introduce?
feature/bugfix
closes #15574

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?
in esm build dependencies webpack supports only node: prefixed Node.js modules (like node:url)

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@sokra sokra merged commit 84aa5cf into main Mar 28, 2022
@sokra sokra deleted the support-node-prefix-in-build-deps branch March 28, 2022 07:31
@sokra
Copy link
Member

sokra commented Mar 28, 2022

Thanks

@sokra
Copy link
Member

sokra commented Mar 28, 2022

But we need a story for non-node: prefixed dependencies too

@sokra
Copy link
Member

sokra commented Mar 28, 2022

You can get a list of all builin modules in the current Node.js via require("module").builtinModules

@ghengeveld
Copy link

ghengeveld commented Apr 11, 2022

I've been avoiding an upgrade for node-fetch because they import node:http nowadays, but since we bundle everything up to support Node 12, it fails.

Error: Cannot find module 'node:http'

Will this fix resolve the problem? I'd appreciate some pointers on the proper Webpack config to support Node 12 and up.

See also node-fetch/node-fetch#1367 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't resolve node builtin modules in esm build dependency
4 participants