1

I'm having some error using HotModuleReplacement. I can't use it actually, it says that __webpack_hmr is not found.

In /node_modules/webpack-hot-middleware/client.js I have this configuration by default:

/*eslint-env browser*/
/*global __resourceQuery __webpack_public_path__*/

var options = {
  path: "/__webpack_hmr",
  timeout: 20 * 1000,
  overlay: true,
  reload: false,
  log: true,
  warn: true
};

But I don't have a '__webpack_hmr' under my basedir. Where it suposses to be located that, is a file? I'm pretty confused, trying to use Brosersync, webpack, HMR. I'm just testing some React Admin Panel, I already asked to the author on Github without response. Please help.

This is part of my webpack config:

entry: [
    './src/webpack-public-path',
    'webpack-hot-middleware/client?reload=true',
    './src/index'
  ],
  target: 'web',
  output: {
    path: `${__dirname}/src`,
    publicPath: '/',
    filename: 'bundle.js'
  },
plugins: [
    new webpack.DefinePlugin({
          'process.env.NODE_ENV': JSON.stringify('development'),
          __DEV__: true
        }),
new webpack.HotModuleReplacementPlugin(), etc...

Some topics like Webpack hmr: __webpack_hmr 404 not found provides solutions that have no sense, plus aren't like my case.

I'm using Cluod9 IDE, so I don't have a localhost, I have to define the host by hand somewhere.

Community
  • 1
  • 1
pmiranda
  • 7,602
  • 14
  • 72
  • 155
  • damn... was my fault. I had to use https with Cloud9, that was all. I test a lot of things ffs during 5 hours. – pmiranda May 03 '17 at 21:24

1 Answers1

1

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

user1015434
  • 83
  • 1
  • 6