dev-server claims it compiles but doesn't
See original GitHub issueI’m trying to get started with webpack-dev-server but have run into a problem. I configured webpack to compile a file index.js to build/app.js and this works fine as long as I use manual “webpack” or “webpack --watch” but when i use webpack-dev-server --open" the page is shown correctly but never updated when I edit index.js. When I edit index.js I see the following output on the console
webpack: Compiling...
Hash: 68a1e5de074822c30fe2
Version: webpack 2.2.1
Time: 44ms
Asset Size Chunks Chunk Names
app.js 315 kB 0 [emitted] [big] app
chunk {0} app.js (app) 301 kB [entry] [rendered]
[35] ./index.js 130 bytes {0} [built]
+ 85 hidden modules
webpack: Compiled successfully.
The file app.js is never touched though. This happens with webpack 2.2.1 and webpack-dev-server 2.3.0.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Webpack-dev-server compiles files but does not refresh or ...
The webpack-dev-server starts up, the module loader test works (i.e. when I save any .vue file it causes webpack to recompile), but: The...
Read more >Output Management - webpack
Webpack will generate the files and put them in the /dist folder for you, but it doesn't keep track of which files are...
Read more >Why webpack-dev-server Live-Reload Is Not Working - Medium
One of the goals of webpack-dev-server is to shorten the feedback loop between coding and seeing the result. This increases productivity.
Read more >Solution for Webpack 5 Dev Server Not Live Reloading
There is currently a bug with Webpack 5 and webpack- dev-server not working that is caused by the existence of a browserslist in...
Read more >Webpack doesn't output bundle.js (Example) - Treehouse
js$/, exclude: /node_modules/, loaders: [ 'react-hot', 'babel' ] } ] } };. And the terminal returns with this message: webpack: Compiled ...
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 Free
Top 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

This feature
If you're having trouble, navigating to the /webpack-dev-server route will show where files are served. For example, http://localhost:9000/webpack-dev-server.(src) saves me, I was able to understand how files are served, then I have changed it by publicPath. 🎉My problem was in my multiple webpack config environment, so files were served in named contexts. Like: http://localhost:9000/webpackConfig1/yourFiles http://localhost:9000/webpackConfig2/yourFiles … etc
@serheyShmyg, I tried your repository. It’s a configuration issue. Your
/index.htmlfile tries to use the JS and CSS files from thebuild/folder, but webpack-dev-server doesn’t put its file there so it uses the existing files from this folder.I made a PR for you, fixing your issues. You’re lucky I had some time to kill 😄 (https://github.com/serheyShmyg/frontend/pull/1).
@dennisjac see the above PR for an example. If you still have an issue, please ask on StackOverflow. If you link me to it perhaps I’ll take a look.