webpack-dev-server: v3.3.0 - HMR stopped working - React Hot Loader

  • Operating System: macOS Mojave 10.14.3
  • Node Version: 10.14.2
  • NPM Version: 6.4.1
  • webpack Version: 4.29.6
  • webpack-dev-server Version: 3.3.0
  • This is a bug
  • This is a modification request

Expected Behavior

Hot Module Replacement using react-hot-loader must work.

Actual Behavior

Hot Module Replacement using react-hot-loader broke with webpack-dev-server v3.3.0 but it works if I go back to v3.2.1

For Bugs; How can we reproduce the behavior?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

Using path.resolve(process.cwd(), 'src') is wrong (when you change file, like Play.jsx, it is causes fs event - change so webpack-dev-server reload you page), you need static directory, not src, in src you store your source code, in static you store static files (usually they copied to dist/build directory)

@shahzaibkhalid Why you think it is problem with react-hot-loader? You contentBase is process.cwd() so you watch all changes in process.cwd() (include node_modules), looks somebody write new files in node_modules and you get refresh