When it loads everything is ok and hmr works. Then this error appears.
GET http://localhost:3000/__webpack_hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING
It looks like webpackdevserver, but then reboots, it takes a few seconds, and hmr works again.
[HMR] connected
then crash, etc.
It seems that I have this problem only in Chrome (version 55) (tested with mozilla and this problem does not appear).
I might have missed something in my webpack or node conf, but can't find anything in the document.
Any idea how to fix this?
// BELOW Webpack conf
const path = require('path');
const merge = require('webpack-merge');
const TARGET = process.env.NODE_ENV;
process.env.BABEL_ENV = TARGET;
const webpack = require('webpack');
const NpmInstallPlugin = require('npm-install-webpack-plugin');
const PATHS = {
app: path.join(__dirname, 'client'),
build: path.join(__dirname, 'build')
};
const common = {
entry: {
app: [PATHS.app, 'webpack-hot-middleware/client']
},
resolve: {
extensions: ['', '.js', '.jsx']
},
output: {
path: PATHS.build,
filename: 'bundle.js',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.css$/,
loaders: ['style', 'css'],
include: PATHS.app
},
{
test: /\.jsx?$/,
loaders:['babel?cacheDirectory=true'],
include: PATHS.app
}
]
}
};
if(TARGET === 'dev' || ! TARGET) {
module.exports = merge(common, {
export: {
isDev: true
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('dev')
}),
new NpmInstallPlugin({
save: true
})
],
devtool: 'eval-source-map'
});
}
if(TARGET === "build") {
module.exports = merge(common, {});
}
// Nodejs route
this.app.get('/', function(req,res) {
res.sendFile(path.join(__dirname, './../../build/index.html'))
})
//index.html
<!DOCTYPE html>
<html>
<head>
<title> Ripple Data Analyzer</title>
</head>
<body>
<div id='root'>
</div>
<script src="bundle.js"></script>
</body>
</html>
//index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
ReactDOM.render(<App/>, document.getElementById('root'));