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

importing redux-devtools/lib/react breaks hot reloading #69

Closed
dvdzkwsk opened this issue Aug 15, 2015 · 6 comments
Closed

importing redux-devtools/lib/react breaks hot reloading #69

dvdzkwsk opened this issue Aug 15, 2015 · 6 comments

Comments

@dvdzkwsk
Copy link

If I import redux-devtools/lib/react in a project, even if it's not used, hot-reloading no longer works. It happens for all files, and I've entirely disabled the DevTool component as well as the devTool middleware, so the only reference to redux-devtools is an unused import. I'll try to gather more information, but here's the warning from Webpack:

[HMR] Cannot apply update. Need to do a full reload!
dev-server.js:19 [HMR] Error: Aborted because 198 is not accepted
    at hotApply (http://localhost:3000/vendor.1147cd2c761079891a5b.js?1147cd2c761079891a5b:400:31)
    at hotUpdateDownloaded (http://localhost:3000/vendor.1147cd2c761079891a5b.js?1147cd2c761079891a5b:313:13)
    at hotAddUpdateChunk (http://localhost:3000/vendor.1147cd2c761079891a5b.js?1147cd2c761079891a5b:293:13)
    at webpackHotUpdateCallback (http://localhost:3000/vendor.1147cd2c761079891a5b.js?1147cd2c761079891a5b:49:12)
    at http://localhost:3000/1.1147cd2c761079891a5b.hot-update.js:1:1

where 198 is [198] ./~/react-redux/lib/index.js 556 bytes. Maybe I'm just doing something weird that's causing this issue, so I'll try to isolate it to as small of an example as possible, but hot-reloading completely works until I add the import statement. Package versions are as follows:

    "react-redux": "^0.8.0",
    "redux": "^1.0.0",
    "react-hot-loader": "^1.2.8",
    "redux-devtools": "^1.0.0",

Any help is appreciated, even if you could just point me in the right direction. Thanks!

@dvdzkwsk
Copy link
Author

Note: It looks like it might be related to bundle splitting, where React is in the vendor bundle but redux-devtools and redux-devtools/lib/react are not. So not sure if this is a Webpack issue or just a result of my inexperience. Updating my vendor dependencies to include all 3 has fixed the issue; maybe somebody smarter than me could shed some light on why that fixes it?

@gaearon
Copy link
Contributor

gaearon commented Aug 15, 2015

Maybe some naive regex catches react and thinks it's React distribution? (I don't know, just a wild guess.)

If you put up a branch reproducing the issue I can take a look.

@gaearon
Copy link
Contributor

gaearon commented Aug 15, 2015

Here's another weird issue: #63

@dvdzkwsk
Copy link
Author

You're exactly right, it's related to me specifying the string 'react' as a vendor dependency in conjunction with the CommonsChunkPlugin, where Webpack splits on /'s which ends up matching redux-devtools/lib/react. So it's not at all related to the package redux-devtools itself.

Not exactly sure how to get around this since, according to the Webpack documentation, to bundle React separately you're supposed to pass a string literal "react", but that could end up conflicting with any other module that happens to match that pattern (case in point this issue). But that's a discussion for elsewhere; thanks for your help!

@justinobney
Copy link

I was getting the same issue, but I was able to get around it by taking react-redux out of my vendor dependencies list.

@gaearon
Copy link
Contributor

gaearon commented Sep 27, 2015

I'm closing, since it's a consumer configuration issue and not really ours. We can't fix it without making a breaking change by renaming the folder—but we don't really have to because in the next version the log monitor is extracted into a separate project, and there is no redux-devtools/lib/react.

Please track the progress and give feedback in #132.

@gaearon gaearon closed this as completed Sep 27, 2015
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

3 participants