webpack-dev-server: Source Map (`sockjs.js.map`) results in 404 request
- Operating System: OSX
- Node Version: 6.11.5
- NPM Version: 3.10.10
- webpack Version: 3.8.1
- webpack-dev-server Version: 2.9.3
- This is a bug
- This is a feature request
- This is a modification request
Code
// webpack.config.js
Actual Behavior
In recent releases, when using the Chrome inspector, a source map for sockjs is detected and a request is made to the server for /sockjs.js.map, which 404’s on the server side. It’d be nice if the source map directive could be removed to avoid this.
//# sourceMappingURL=sockjs.js.map
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 22 (9 by maintainers)
I added
devtool: 'inline-source-map'in webpack.config.js. It seems to work for me.This save my day too. Thanks!
added devtool: ‘inline-source-map’ in webpack.config.js. It seems to work for me.
Even I tried
inline-source-map, firefox console still complains, it won’t show innetworktab.I have tried all 7 type of source maps with mimium context (no babel, no any transformations, just pure webpack with two simple js)
chrome mentions
souce maps detected, but it is never show it.This worked for me as well. Be sure to restart your webpack server after updating webpack.config.js.
I’ve ran into this issue today, and I just wanna comment for everyone’s information, that sometimes those 404 errors result from the HTML file and the dev server running on different ports. In my case, it was a Roda app running on localhost:9292 (generating HTML) and the dev server running on localhost:8080. The dev server tried to guess to connect to localhost:9292 (based on
window.location), which naturally results in 404s.devServer.publicis your friend here.@shellscape thanks for the reply, but can you elaborate?
inline-source-map- A SourceMap is added as a DataUrl to the bundle. Source maps are an integral tool to accurately pinpointing bugs within our source code (the files we actually write code in). Very helpful for debugging. here is the documentation : https://webpack.js.org/configuration/devtool/you saved my life