Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.6.0 cause some error. #1131

Closed
fwh1990 opened this issue Dec 17, 2018 · 11 comments
Closed

Version 4.6.0 cause some error. #1131

fwh1990 opened this issue Dec 17, 2018 · 11 comments

Comments

@fwh1990
Copy link

fwh1990 commented Dec 17, 2018

Description

// Error message
TypeError: Cannot read property 'call' of undefined
// Source code
module.updateTimeout = setTimeout(function () {
      try {
        requireIndirect(sourceModule.id);
      } catch (e) {
        console.error(e);   // Yep, emit error from here.
      }
      module.instances.forEach(function (inst) {
        return inst.forceUpdate();
      });
});

Expected behavior

Version 4.5.2 is ok.

Actual behavior

Version 4.6.0 break.

Environment

React Hot Loader version:

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

  1. node -v : 8.11.4
  2. yarn -v: 1.12.3

Then, specify:

  1. Operating system: macOs
  2. Browser and version: chrome latest

Reproducible Demo

No, sorry.

@theKashey
Copy link
Collaborator

As far as I know - it does not emit error - it report error.

@theKashey
Copy link
Collaborator

Try 4.6.1. It does not change anything, except messaging around real error.

@fwh1990
Copy link
Author

fwh1990 commented Dec 17, 2018

And then I got more message

React-Hot-Loader: error detected while loading ./src/components/app/App.tsx

App.tsx is a root component in my project. I use @babel/preset-typescript to compile ts code.

@fwh1990
Copy link
Author

fwh1990 commented Dec 17, 2018

You should know that the error message only appear at first time. And no side effect happened, the RHL can work as usual.

@theKashey
Copy link
Collaborator

I shall not swallow the error. Something is not right, and it should report what exactly and where.
PS: You may manually remove try/catch block around require, and double check the root issue.

@fwh1990
Copy link
Author

fwh1990 commented Dec 18, 2018

Error from webpack

modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

@fwh1990
Copy link
Author

fwh1990 commented Dec 18, 2018

When I remove webpack.DllReferencePlugin(...) from my webpack config. The error gone.

And it's impossible to remove this plugin for me, because hot-reload is too slow without dll.js

@theKashey
Copy link
Collaborator

So - look like this error is a real error.

Try https://github.com/mzgoddard/hard-source-webpack-plugin

@fwh1990
Copy link
Author

fwh1990 commented Dec 18, 2018

I have added hard-source-webpack-plugin in webpack config, but nothing changed. Am I need to input some options into this plugin?

@theKashey
Copy link
Collaborator

Remove DLL plugin and use only Hard one - and you shall get the same good speed.

@fwh1990
Copy link
Author

fwh1990 commented Dec 19, 2018

Remove DLL plugin and use only Hard one - and you shall get the same good speed.

Yeah, I have the same speed now. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants