React-hot-loader: v4.6.4 "TypeError: leaveModule is not a function"

Created on 31 Jan 2019  路  12Comments  路  Source: gaearon/react-hot-loader

If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.

Description

run yarn dev
receive an ERROR "TypeError: leaveModule is not a function"
if use v4.6.3
all normal

Expected behavior

no issue

Actual behavior

/Users/hanlike/Documents/neuronFE/node_modules/webpack-cli/bin/cli.js:235
                                throw err;
                                ^

TypeError: leaveModule is not a function
    at /Users/hanlike/Documents/neuronFE/configs/webpack.config.base.js:141:3
    at Object.<anonymous> (/Users/hanlike/Documents/neuronFE/configs/webpack.config.base.js:142:3)
    at Module._compile (/Users/hanlike/Documents/neuronFE/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
    at Module._compile (/Users/hanlike/Documents/neuronFE/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:699:10)

Environment

webpack 4.29
Typescript 3.2
babel 7
repo https://github.com/electron-react-boilerplate/examples/tree/master/examples/typescript

React Hot Loader version: v4.6.4

Run these commands in the project folder and fill in their results:

  1. node -v:v10.13.0
  2. npm -v:yarn 1.12.3

Then, specify:

  1. Operating system: macos mojove
  2. Browser and version:Chrome 71

Reproducible Demo

Please take the time to create a new project that reproduces the issue.

You can copy your project that experiences the problem and start removing things until you鈥檙e left with the minimal reproducible demo. This helps contributors, and you might get to the root of your problem during that process.

Push to GitHub and paste the link here.

Most helpful comment

Yeap, that was an issue with npm cache, even after node_modules clean install.
Thanks for clue and quickfix

All 12 comments

I met the same problem

https://github.com/gaearon/react-hot-loader/compare/v4.6.3...v4.6.4#diff-66ea0cdc3989360adbd4955babda95e0R46

Should we make an empty check?

image

+1

Same

+1

馃敟

Honestly - I have no idea why this code got executed on webpack side. But:

  • 4.6.4 deprecated
  • 4.6.5 released

4.6.5 - still same error
How simple version bump should have fixed this?

+1

@blinkzz - 4.6.5 should contain a patch - https://github.com/gaearon/react-hot-loader/commit/6f8573fb44f7089d24e7c6f4af0246bf87477fff

You might have you code cached. Or delete the cache (node_modules/.cache or /tmp), or change anything in your .babelrc, and re-run.

Yeap, that was an issue with npm cache, even after node_modules clean install.
Thanks for clue and quickfix

v4.6.5 fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

niba picture niba  路  4Comments

ghost picture ghost  路  3Comments

mtscout6 picture mtscout6  路  3Comments

JamesIves picture JamesIves  路  4Comments

calvinchankf picture calvinchankf  路  3Comments