Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Hot load issue since update #15

Closed
ioRekz opened this issue Aug 15, 2015 · 8 comments
Closed

Hot load issue since update #15

ioRekz opened this issue Aug 15, 2015 · 8 comments
Labels

Comments

@ioRekz
Copy link

ioRekz commented Aug 15, 2015

Do you manage to hot reload code ?

I updated my project today to reflect your changes and webpack is unable to hot reload.

[HMR] Cannot apply update. Need to do a full reload!
dev-server.js:19
[HMR] Error: Aborted because 198 is not accepted

To be sure, I cloned a fresh copy and had the same issue

@dvdzkwsk
Copy link
Owner

Hey, I just went and tested a few components after a fresh install and couldn't reproduce this issue. Is there a specific file or code segment that's causing you problems?

Running npm run dev on localhost:3000 and updating the render method of ~/src/components/todo-list:

[WDS] App hot update...
app.a0a1c058756778599190.js:10194 [HMR] Checking for updates on the server...
app.a0a1c058756778599190.js:10228 [HMR] Updated modules:
app.a0a1c058756778599190.js:10230 [HMR]  - 272
app.a0a1c058756778599190.js:10180 [HMR] App is up to date.

@ioRekz
Copy link
Author

ioRekz commented Aug 15, 2015

No, all of them. I'll continue testing then

On Sat, Aug 15, 2015 at 1:14 PM, David Zukowski notifications@github.com
wrote:

Hey, I just went and tested a few components and couldn't reproduce this
issue. Is there a specific file that's causing you problems?


Reply to this email directly or view it on GitHub
#15 (comment)
.

@ioRekz
Copy link
Author

ioRekz commented Aug 15, 2015

I'm still trying. I observe this only in dev:debug mode. Could you try as well please ? I continue to look for the root problem, thanks

@dvdzkwsk
Copy link
Owner

So hot-reloading works in regular dev mode, but not dev:debug? I'll go try myself; the only thing that :debug adds is the redux-devtools, so I'll look into that.

Edit: Managed to reproduce it with dev:debug, looking into a fix now.

@dvdzkwsk
Copy link
Owner

So even if I completely disable the devTool middleware and monitoring component, as long as redux-devtools/lib/react is imported hot-reloading breaks. I'm trying to troubleshoot the issue, but in the meantime I've submitted a bug in the redux-devtools project: reduxjs/redux-devtools#69

@dvdzkwsk
Copy link
Owner

I've temporarily fixed this by adding redux-devtools and redux-devtools/lib/react to the vendor dependencies. Can you please try pulling the latest master branch to see if it's fixed for you?

@ioRekz
Copy link
Author

ioRekz commented Aug 16, 2015

fixed for me, thanks ! Just to be sure I understand because I'm new to webpack : this now works because redux-devtools and react-devtools are now bundled in the vendor asset and its not part of the hot reloaded module anymore ?

@dvdzkwsk
Copy link
Owner

Hey, there's a bit more in-depth discussion here: reduxjs/redux-devtools#69, but the gist of it is:

This starter kit is splitting vendor dependencies, which are listed as just simple strings that Webpack matches against imported packages. The key is that Webpack splits on /'s when matching something, meaning the string "react" will match the package "react" as well as, unfortunately, "redux-devtools/lib/react" because it ends up matching against that last "react". By explicitly defining both "react" and "redux-devtools/lib/react" as packages in the vendor bundle, Webpack will pre-bundle both of them thus solving the issue.

An issue still exists where if you were to bundle anything else that matched "react" you'd run into the same issue, so I'm still digging around for another fix, but that's a bit of an edge case at the moment.

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

No branches or pull requests

2 participants