Webpack-dev-server: Browser not refreshing

Created on 28 Jun 2015  路  14Comments  路  Source: webpack/webpack-dev-server

Hi

The browser does not refresh automatically even though the file has updated. I have to manually refresh the browser.

This is the console output from the browser

[HMR] Waiting for update signal from WDS...
webpack-dev-server.js:1 [WDS] Hot Module Replacement enabled.
2webpack-dev-server.js:1 [WDS] App updated. Recompiling...
webpack-dev-server.js:1 [WDS] App hot update...
dev-server.js:52 [HMR] Checking for updates on the server...
log-apply-result.js:20 [HMR] Updated modules:
log-apply-result.js:22 [HMR] - 3
log-apply-result.js:22 [HMR] - 0
dev-server.js:38 [HMR] App is up to date.

This is my config

var path = require('path');
module.exports = {
entry: [
'webpack/hot/dev-server',
path.resolve(__dirname, 'app/test/main.js'),
],
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js',
}
};

Im calling it via this command from the package.json

"start": "webpack-dev-server --config webpack.development.js --devtool eval --progress --colors --hot --content-base public"

thanks

Most helpful comment

This was driving me insane, I have got it working by removing --hot and including
plugins: [
new webpack.HotModuleReplacementPlugin()
]

in the webpack.config file.

All 14 comments

+1 same here

It seems like almost everyone is plagued with this. I've spent 2 hours trying to get this working, and haven't managed to find one full single working example, only snippets, and when you pull them together, it's not watching and packaging the files.

This was driving me insane, I have got it working by removing --hot and including
plugins: [
new webpack.HotModuleReplacementPlugin()
]

in the webpack.config file.

+1 same here, @daniel-erickson the fix works for me too, thanks!

Updating WP to 1.10.1 fixed my issues.

Yeah, can confirm that 1.10.1 fixed it. Thanks!

I am seeing this issue with 1.11.0 and dev-server 1.10.1. Had to replace hot: true with:

plugins: [
new webpack.HotModuleReplacementPlugin()
]

to get it working

this is sooo bad documented

@smaye81
Fixed in same way!

Thank you

@smaye81 In my case , doing your solution reload the full page, not HMR.

@smaye81 Thank you, same as webpack-dev-server@^1.16.2

I had the same problem. I know it's a old topic but I have my webpack on port 9000 and application on port 3000 so in devServer I added:

headers: {
            'Access-Control-Allow-Origin': '*'
        }

Hope it helps.

can confirm @daniel-erickson and @smaye81 's solution works in webpack 3.4.1 and webpack-dev-server 2.6.1 (reloading not working issue)

I am seeing this issue with 1.11.0 and dev-server 1.10.1. Had to replace hot: true with:
plugins: [
new webpack.HotModuleReplacementPlugin()
]
to get it working

Was this page helpful?
0 / 5 - 0 ratings