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

Error messages from react-hot-loader #47

Open
jeremija opened this issue Nov 2, 2019 · 0 comments
Open

Error messages from react-hot-loader #47

jeremija opened this issue Nov 2, 2019 · 0 comments

Comments

@jeremija
Copy link
Contributor

jeremija commented Nov 2, 2019

The current example/ uses an old version of react-hot-loader which silently swallows require errors:

https://github.com/gaearon/react-hot-loader/blob/62f9ccdd076b26302dae077c23de3dd6812ebd97/src/hot.dev.js#L27-L31

The latest version of react-hot-loader always logs require errors:

https://github.com/gaearon/react-hot-loader/blob/3fadc05783f2aa534372dbe6846b1a379ed76ebd/src/hot.dev.js#L86-L93

Steps to reproduce:

https://github.com/Macil/browserify-hmr
cd browserify-hmr/example
npm install
npm install react-hot-loader@latest
npm start

After modifying Label.jsx, the component refreshes in the browser, but an error is present in browser console:

[HMR] Websocket connection successful. index.js:424
interval step 3 interval.js:8:10
[HMR] Updated modules 
Array [ "Label.jsx" ]
index.js:512
React-Hot-Loader: error detected while loading Label.jsx backend.js:6:2315
Error: "Cannot find module 'Label.jsx'"
    o _prelude.js:1
    o _prelude.js:1
    updateInstances react-hot-loader.development.js:3096
    runAll react-hot-loader.development.js:2998
    runAll react-hot-loader.development.js:2997
    runner react-hot-loader.development.js:2989
    promise react-hot-loader.development.js:3006
backend.js:6:2315
interval step 2 interval.js:8:10

It looks like the problem is the fact that browserify is converting module ids to numerical indexes, so the require('Label.jsx') call fails. I've also tried using --fullPaths, but that also fails because it would expect an absolute path to Label.jsx, not just Label.jsx.

The hot reload still seems to work, but I wonder if there's anything that could be done to fix this?

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

1 participant