`Module build failed` with devtool option to have source maps with original source quality
See original GitHub issueWhen using webpack’s devtool
option so as to obtain source maps with original source, like, e.g., eval-cheap-module-source-map
, eval-source-map
, or cheap-module-source-map
, the build fails with the following error. (For bundled, generated, or transformed code, there is no error and the plugin works as expected.)
ERROR in ./src/index.js
Module build failed (from ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js):
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
at readWasm (/Users/.../node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/source-map/lib/read-wasm.js:8:13)
at wasm (/Users/.../node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/source-map/lib/wasm.js:25:16)
at BasicSourceMapConsumer.then.that (/Users/.../node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/source-map/lib/source-map-consumer.js:264:14)
@ multi ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ErrorOverlayEntry.js ./src main[3]
We use a server-side application with a custom Express HTML server making use of Webpack Dev Middleware and Webpack Hot Middleware, like, e.g., at https://stackoverflow.com/a/41837779.
Plugin configuration is the following:
new ReactRefreshWebpackPlugin({
forceEnable: true,
overlay: {
sockIntegration: 'whm',
}
})
Versions used: @pmmmwh/react-refresh-webpack-plugin 0.4.1 webpack 4.44.1 webpack-dev-middleware 3.7.2 webpack-hot-middleware 2.25.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Devtool - webpack
devtool performance production quality
(none) build: fastest rebuild: fastest yes bundle
eval build: fast rebuild: fastest no generated
eval‑cheap‑source‑map build: ok rebuild: fast no transformed
Read more >Webpack 5 sourcemap loaded by chrome in different "area"
Since you're using devTool value as source-map . It will load the original code you wrote as source map. This also happened to...
Read more >Quick guide to webpack source map options - Scott Logic Blog
A quick guide to the available source map options in webpack, and the considerations for choosing one in different scenarios.
Read more >Source Maps - SurviveJS
Enabling source maps in webpack source-map is the slowest and highest quality option of them all, but that's fine for a production build....
Read more >Source maps and how it works - Ehsan Gazar
Using Webpack, specifying devtool: "source-map" in your Webpack config will enable source maps, and Webpack will output a sourceMappingURL ...
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
Released in
v0.4.2
.I’ll patch this in
0.4.2
, probably today/tomorrow.