Use with `react-hot-loader` #29

Closed
iam4x opened this Issue Feb 26, 2015 · 14 comments

Projects

None yet

5 participants

@iam4x
iam4x commented Feb 26, 2015

Using alt with react-hot-loader loader in webpack, throw me random errors:

Cannot not apply hot update to users.jsx: A store named UserStore already exists, double check your store names or pass in your own custom identifier for each store

I couldn't find what isn't working, went through this issue: moreartyjs/todomvc-moreartyjs#2

Maybe something with the context?

@goatslacker
Owner

It sounds like it's recreating the stores which is not a good thing. I'll take a closer look at this. If you have any code you can share please do :)

@iam4x
iam4x commented Feb 26, 2015

https://github.com/iam4x/isomorphic-flux-boilerplate

Edit app/component/users.jsx with changing something in render() twice, it will be thrown in the console.

@frederickfogerty
Contributor

Would love for this to work, this is one of the major pains with react-hot-loader and alt. It reloads the relevant changed scripts so I thought it just couldn’t be fixed easily. 👍

@goatslacker
Owner

So it's a webpack bug:

webpack/webpack#826

Let me think of ways to get around this in the meantime

@gaearon
gaearon commented Feb 27, 2015

Yeah it's a Webpack bug. It's been annoying for months but I just got around to isolating it yesterday. Hopefully the fix is in the works!

@goatslacker
Owner

Fixed by webpack :)

@goatslacker goatslacker closed this Mar 3, 2015
@gaearon
gaearon commented Mar 4, 2015

You'll need to update Webpack to 1.7.0 to get the fix.

@bizmurr
bizmurr commented Mar 18, 2015

Hmm.. I am still receiving this error on Webpack 1.7.3, any thoughts @gaearon @goatslacker @iam4x?

@frederickfogerty
Contributor

Double check you are on the latest version - ever since I upgraded to 1.7 I haven't had this issue

On Wed, Mar 18, 2015 at 7:17 PM, bizmurr notifications@github.com wrote:

Hmm.. I am still receiving this error on Webpack 1.7.3, any thoughts @gaearon @goatslacker @iam4x?

Reply to this email directly or view it on GitHub:
#29 (comment)

@bizmurr
bizmurr commented Mar 18, 2015

Yeah, I am on 1.7.3 and still get the error when I make some code changes to a Store and then save, is this a different issue entirely?

@gaearon
gaearon commented Mar 18, 2015

The original bug is about changing the component:

Edit app/component/users.jsx with changing something in render() twice, it will be thrown in the console.

If you make changes in the store, there's nothing RHL can do: it doesn't know how to handle updates in an Alt store (at least not just yet :-). It only updates components, and files which are required only by components. So yeah, changing the store will throw app into an inconsistent state and you need to either manually refresh, or use hot/dev-server instead of hot/only-dev-server to refresh automatically.

@bizmurr
bizmurr commented Mar 18, 2015

Ah I see, thanks for the clarification!

@goatslacker goatslacker reopened this Mar 18, 2015
@goatslacker
Owner

Actually let me open a new ticket.

@goatslacker
Owner

#85

@Killavus Killavus added a commit to arkency/react_flux_alt_immutable_todolist that referenced this issue Jul 3, 2015
@Killavus Killavus Updated webpack to the newest version.
There was an issue with Webpack
(goatslacker/alt#29) that caused stores to be
reloaded even when a component is updated. I encountered this issue and
it is fixed in newer webpack releases - so I decided to update it.
a470861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment