mini-css-extract-plugin: HMR stops updating after first error, reports as unaccepted module

  • Operating System: Windows 10
  • Node Version: 10.x
  • NPM Version: 9.6.0
  • webpack Version: 4.35.3
  • mini-css-extract-plugin Version: 0.8.0

Expected Behavior

Given is a Less file styles.less, in which we accidentally introduce an error and then save. HMR attempts an update and it shows the errored compilation.

After fixing the error, HMR should correctly load the fixed compiled CSS.

Actual Behavior

Instead of loading the fixed compiled CSS, HMR reports Ignored an update to unaccepted module ./styles.less and fails to update.

After having received a failed compilation, the module will continue to not accept hot updates until having manually reloaded the web page.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@evilebottnawi

The testcase is available now as mini-css-extract-plugin-hmr-testcase.

The readme contains a few manual instructions. (Sorry, couldn’t get that to work automated.) It also contains some npm tasks to swap between the package version of mini-css-extract-plugin and the fork that I patched. And it contains a short rundown of what/how/why changes are applied to the forked plugin to make error-recovery/resilience work.

If you want I can also open a PR from the fork.