Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cdaringe/8f8a115ae66d7ed40dea to your computer and use it in GitHub Desktop.
Save cdaringe/8f8a115ae66d7ed40dea to your computer and use it in GitHub Desktop.
hot-reload-webpackHotUpdate-is not-defined
// cmd
webpack-dev-server --content-base build/ --port 22222 --host 0.0.0.0 https --hot --inline
// bundles succesfully...
// ...
[206] ./~/lodash/internal/assignDefaults.js 428 bytes {2} [built]
webpack: bundle is now VALID.
webpack: bundle is now INVALID.
Hash: 6fe8e8f6ff34328aecc6
Version: webpack 1.10.0
Time: 1188ms
// i make a change in a watched file, all is still well ...
webpack: bundle is now INVALID.
Hash: c5b7a6a94d98edaaf23e
Version: webpack 1.10.0
Time: 1356ms
... a bunch of chunk content ...
webpack: bundle is now VALID.
// no hot update is applied, so i visit https://mydomain.org:22222/webpack-dev-server
// i click one one of the hotupdate URLs, and recieve:
Uncaught ReferenceError: webpackHotUpdate is not defined
// :(
// webpack.config.js
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
var path = require('path');
var isDev = process.env.COINS_ENV === 'development';
var pluginCompress;
module.exports = {
entry: {
tracker: './ampersand/app.js',
main: './global-utils.js'
},
output: {
path: path.join(__dirname + '/build', 'js'),
filename: '[name].bundle.js'
},
plugins: [
new CommonsChunkPlugin('global.bundle.js', ['tracker', 'main']),
]
};
// conditionally load extra configs
if (!isDev) {
pluginCompress = new UglifyJsPlugin({
compress: {
warnings: false
}
});
module.exports.plugins.push(pluginCompress);
}
@cdaringe
Copy link
Author

i see the error in the browser js console

@mikeLspohn
Copy link

@cdaringe I'm running into the same issue. Did you find a fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment