Webpack-dev-server: 404 Not Found for <host>/__webpack_hmr

Created on 10 Jul 2017  路  6Comments  路  Source: webpack/webpack-dev-server

Do you want to request a feature or report a bug?
Report a bug.

What is the current behavior?
When running webpack-dev-server using the configuration detailed in the Gist below, the browser console emits http://localhost:8080/__webpack_hmr 404 (Not Found) errors, and HMR does not work correctly.

If the current behavior is a bug, please provide the steps to reproduce.
https://gist.github.com/jonlambert/2e38092c7527ec97329911882de29d91

What is the expected behavior?
For HMR to work correctly, with the client connecting to the websocket endpoint whilst using webpack-dev-server.

Please mention your webpack and Operating System version.

  • macOS Sierra
  • Webpack version 2.6.1
question

Most helpful comment

You can fix this issue by removing 'webpack-hot-middleware/client' from your webpack config.

All 6 comments

You can fix this issue by removing 'webpack-hot-middleware/client' from your webpack config.

Thank you @Panoplos and have a great day! :)

@Panoplos I tried removing it and hot-reloading doesn't work for me.

thanks @Panoplos. there are two ways for webpack-dev-server hot update:

  1. webpack-dev-server, hot=true, inline=true
  2. express server: webpack-dev-middleware + webpack-hot-middleware, __webpack_hmr
  const compiler = webpack(webpackConfig);
  webpackConfig.entry.app = ['webpack-hot-middleware/client', webpackConfig.entry.app];
  const devMiddleware = require('webpack-dev-middleware')(compiler, {});
  const app = express();
  app.use(devMiddleware);
  //...

@wuliupo Thanks for the information

'webpack-hot-midd

I did the same, but not working

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StephanBijzitter picture StephanBijzitter  路  3Comments

movie4 picture movie4  路  3Comments

Jack-Works picture Jack-Works  路  3Comments

da2018 picture da2018  路  3Comments

mischkl picture mischkl  路  3Comments