CrocoDillon / universal-react-redux-boilerplate

Step by step creation of a Universal React + Redux Boilerplate
Other
176 stars 33 forks source link

DOM not updating after HMR #10

Closed menberg closed 7 years ago

menberg commented 8 years ago

Hi CrocoDillon,

This boilerplate is amazing. I can learn so much from it.

One issue tough, while running npm run dev, editing the source code triggers a HMR with several HMR related messages logged in the browser console under http://localhost:3000. So HMR seems to be a success: "[HMR] App is up to date." But the changes aren't reflected in the DOM, the website stays the same until I reload the page.

Is this a temporary bug or do I need to do things differently?

Thanks for your help.

CrocoDillon commented 8 years ago

Thanks for your kind words :relaxed: Hot reloading was working fine for me. I’ll try a fresh install later and see what happens.

This could be related: https://github.com/gaearon/react-hot-boilerplate/pull/61#issuecomment-240933323

CrocoDillon commented 8 years ago

Do you see this in your console as well?

[HMR] The following modules couldn't be hot updated: (Full reload needed)
CrocoDillon commented 8 years ago

Seems to be an issue with RHL... I'm trying to come up with a workaround and am open to suggestions at this point :smile:

ducwings commented 8 years ago

This is a great kit. I'm facing the same issue. Do you have a fix/workaround for this yet? Thanks.

CrocoDillon commented 8 years ago

Thanks! Sadly not yet and I know it's frustrating... it is for me too.

ducwings commented 8 years ago

@CrocoDillon I found these ones work with webpack 2 & RHL 3. Could you check? https://github.com/ctrlplusb/react-universally https://github.com/nicksp/redux-webpack-es6-boilerplate

ducwings commented 8 years ago

Please let me know when you have update. Can't wait to try this kit again. Thanks @CrocoDillon

CrocoDillon commented 8 years ago

Yeah will do! Thanks for your patience :blush:

CrocoDillon commented 8 years ago

Fixed in https://github.com/CrocoDillon/universal-react-redux-boilerplate/commit/d5e82b75468b5e2393c6cdfe77def89ef696fb8f (master branch)

I'm sure how it was did work with Webpack 2 before (the require was necessary for Webpack 1 only), maybe something changed there. Als react-router will give a warning now but that will be gone when we migrate to RRv4, probably.

If someone can verify it's fixed I'll close this issue.

CrocoDillon commented 8 years ago

I'll just assume that fixed it :shipit:

CrocoDillon commented 7 years ago

Note to self: make app entry point hot accept itself, no need to call render (so also no need to re-require anything).

Edit: not sure if that doesn't break (Redux) state.

CrocoDillon commented 7 years ago

Well that works, and I am hot reloading the reducer properly but I'm still getting some errors in console (functionally it seems to work just fine though). Opening a new issue for that.