question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dev-server claims it compiles but doesn't

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
luckylookecommented, May 13, 2018

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

4reactions
SpaceK33zcommented, Feb 11, 2017

@serheyShmyg, I tried your repository. It’s a configuration issue. Your /index.html file tries to use the JS and CSS files from the build/ 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found