speed-measure-webpack-plugin icon indicating copy to clipboard operation
speed-measure-webpack-plugin copied to clipboard

Using SpeedMeasurePlugin with HMR seems to somehow break the HotModuleReplacementPlugin

Open scottdickerson opened this issue 4 years ago • 3 comments

Here was my configuration:

const devPlugins = [
  new webpack.HotModuleReplacementPlugin(),
  new ReactRefreshWebpackPlugin({
    overlay: {
      sockIntegration: 'whm',
    },
  }),
new SpeedMeasurePlugin();
module.exports = smp.wrap({
entry: {
    main: isDev ? ['webpack-hot-middleware/client', './src/index.jsx'] : ['./src/index.jsx'],
  },
...

Inside my browser I get an error from the webpack-hot-middleware/client saying Hot Module Loading has been disabled because it can't find module.hot on the javascript files. If I set disable to true for the SpeedMeasurePlugin, the Hot Module Loading starts working again

Here's the browser error

process-update.js?881f:10 Uncaught Error: [HMR] Hot Module Replacement is disabled.
    at eval (process-update.js?881f:10)
    at Object.82100 (vendor.webpack-hot-middleware.js:59)
    at __webpack_require__ (main.js:2655)
    at eval (client.js?0e05:233)
    at Object.93950 (vendor.webpack-hot-middleware.js:27)
    at __webpack_require__ (main.js:2655)
    at checkDeferredModulesImpl (main.js:2969)
    at Function.__webpack_require__.x (main.js:2982)
    at main.js:2988
    at main.js:2989

scottdickerson avatar Feb 05 '21 00:02 scottdickerson

ok I wasa able to reproduce

scottdickerson avatar Feb 05 '21 01:02 scottdickerson

me too, seems like the compilation.compiler is proxyed

compilation.compiler !== compiler

image

kingback avatar Feb 22 '21 10:02 kingback

Seconded - I found this issue after having to get the debugger out on webpack... once I saw the proxy was in SMP, it all fell into place.

Doh.

tstordyallison avatar Nov 11 '22 22:11 tstordyallison