question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in HotModuleReplacementPlugin after upgrading from 2 to 3.

See original GitHub issue

** What is the current behavior?** Upgrading from webpack 2 to 3, runningwebpack in the commandline, gives me an error in HotModuleReplacementPlugin.Removing the plugin makes webpack pass.

C:\Users\Documents\project\node_modules\webpack\lib\HotModuleReplacementPlugin.js:59
                                        records.chunkModuleIds[chunk.id] = chunk.mapModules(m => m.id);
                                                                                 ^

TypeError: chunk.mapModules is not a function
    at chunks.forEach.chunk (C:\Users\Documents\project
    at Array.forEach (native)
    at Compilation.<anonymous> (C:\Users\Documents\project
    at Compilation.applyPlugins2 (C:\Users\Documents\project\node_modules\tapable\lib\Tapable.js:82:14)
    at sealPart2 (C:\Users\Documents\projectn.js:629:10)
    at Compilation.applyPluginsAsyncSeries (C:\Users\Documents\project
    at Compilation.seal (C:\Users\Documents\projectn.js:579:8)
    at C:\Users\Documents\projects:493:16
    at C:\Users\Documents\project\node_modules\tapable\lib\Tapable.js:225:11
    at _addModuleChain (C:\Users\Documents\projectn.js:481:11)
    at processModuleDependencies.err (C:\Users\Documents\projectn.js:452:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
[nodemon] app crashed - waiting for file changes before starting...
  ** What is the expected behavior?**
    I expected a smooth upgrade :)

webpack v3.5.2 node v7.4.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
UchihaVehacommented, Aug 12, 2017

destroy node_modules and npm install - solved my problem with HMR, webpack 3.5.3

0reactions
alexander-akaitcommented, Feb 22, 2018

This problem happens when you have old version webpack. Solution:

  1. Remove webpack from global npm remove -g webpack.
  2. Clear npm cache npm cache clear --force.
  3. Install webpack and deps again.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack Hot Module Replacement does not inject the ...
I eliminated the ExtractTextPlugin from my dev environment but now I get a [HMR] Update failed: Error: Manifest request to http://localhost/hot/ ...
Read more >
A Deep Dive into Hot Module Replacement with Webpack ...
We will learn how to instruct the modules in our application to refresh themselves when they receive a hot update. The hot update...
Read more >
Getting Started · React Hot Loader - Dan gaearon
Step 2 (of 3): Using HMR to replace the root component. To update components when changes occur, you need to add some code...
Read more >
Hot Module Replacement - webpack
err : the error thrown by the callback in second argument or during dependency execution when using ESM dependencies. moduleId : the current...
Read more >
Webpack's Hot Module Replacement Feature Explained
When a hot update failed to replace the code in the browser, the HMR runtime will let webpack-dev-server know. The webpack-dev-server will ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found