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

Use with `react-hot-loader` #29

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

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

This comment has been minimized.

Show comment
Hide comment
@goatslacker

goatslacker Feb 26, 2015

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 :)

Owner

goatslacker commented Feb 26, 2015

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

This comment has been minimized.

Show comment
Hide comment
@iam4x

iam4x 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.

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

This comment has been minimized.

Show comment
Hide comment
@frederickfogerty

frederickfogerty Feb 26, 2015

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. 👍

Contributor

frederickfogerty commented Feb 26, 2015

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

This comment has been minimized.

Show comment
Hide comment
@goatslacker

goatslacker Feb 27, 2015

Owner

So it's a webpack bug:

webpack/webpack#826

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

Owner

goatslacker commented Feb 27, 2015

So it's a webpack bug:

webpack/webpack#826

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

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon 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!

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

This comment has been minimized.

Show comment
Hide comment
@goatslacker

goatslacker Mar 3, 2015

Owner

Fixed by webpack :)

Owner

goatslacker commented Mar 3, 2015

Fixed by webpack :)

@goatslacker goatslacker closed this Mar 3, 2015

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Mar 4, 2015

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

gaearon commented Mar 4, 2015

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

@bizmurr

This comment has been minimized.

Show comment
Hide comment
@bizmurr

bizmurr Mar 18, 2015

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

bizmurr commented Mar 18, 2015

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

@frederickfogerty

This comment has been minimized.

Show comment
Hide comment
@frederickfogerty

frederickfogerty Mar 18, 2015

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)

Contributor

frederickfogerty commented Mar 18, 2015

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

This comment has been minimized.

Show comment
Hide comment
@bizmurr

bizmurr 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?

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

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon 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.

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

This comment has been minimized.

Show comment
Hide comment
@bizmurr

bizmurr Mar 18, 2015

Ah I see, thanks for the clarification!

bizmurr commented Mar 18, 2015

Ah I see, thanks for the clarification!

@goatslacker goatslacker reopened this Mar 18, 2015

@goatslacker

This comment has been minimized.

Show comment
Hide comment
@goatslacker

goatslacker Mar 18, 2015

Owner

Actually let me open a new ticket.

Owner

goatslacker commented Mar 18, 2015

Actually let me open a new ticket.

@goatslacker

This comment has been minimized.

Show comment
Hide comment
@goatslacker
Owner

goatslacker commented Mar 18, 2015

#85

Killavus added a commit to arkency/react_flux_alt_immutable_todolist that referenced this issue Jul 3, 2015

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment