Can't resolve node builtin modules in esm build dependency
See original GitHub issueBug report
What is the current behavior?
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Can't resolve 'url' in '/Users/keenwon/Test/webpack-test'
<w> while resolving 'url' in /Users/keenwon/Test/webpack-test as file
<w> at resolve esm file url
<w> at file dependencies /Users/keenwon/Test/webpack-test/webpack.config.mjs
<w> at file /Users/keenwon/Test/webpack-test/webpack.config.mjs
<w> at resolve commonjs /Users/keenwon/Test/webpack-test/webpack.config.mjs
If the current behavior is a bug, please provide the steps to reproduce.
works fine, no warnings
What is the expected behavior?
Other relevant information: webpack version: 5.70.0 Node.js version: v14.19.0 Operating System: macOS 12.3 Additional tools:
demo
repo https://github.com/keenwon/webpack-test, switch to node-prefix branch
node:
doesn’t work either
Issue Analytics
- State:
- Created a year ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
esbuild cannot resolve node built-in modules starting with `_`
When I try to bundle a file that imports _http_common , which is a Node built-in module, esbuild throws an error Could not...
Read more >esbuild cannot resolve the Node.js module 'events'
I discovered this issue when searching around, but the offending line is in a dependency, so I cannot simply edit its source to...
Read more >Getting Started - ESBuild
Getting Started. #Install esbuild. First, download and install the esbuild command locally. A prebuilt native executable can be installed using npm (which ...
Read more >rollup.js
To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use...
Read more >esbuild-node-externals - npm
Start using esbuild-node-externals in your project by running `npm i esbuild-node-externals`. There are 49 other projects in the npm ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a problem… For now I can suggest to use commonjs config format…
solved in https://github.com/webpack/webpack/pull/15611