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

Use with `react-hot-loader` #29

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

Use with `react-hot-loader` #29

iam4x opened this issue Feb 26, 2015 · 14 comments

Comments

@iam4x
Copy link

@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
Copy link
Owner

@goatslacker 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
Copy link
Author

@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
Copy link
Contributor

@frederickfogerty 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
Copy link
Owner

@goatslacker 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
Copy link

@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
Copy link
Owner

@goatslacker goatslacker commented Mar 3, 2015

Fixed by webpack :)

@goatslacker goatslacker closed this Mar 3, 2015
@gaearon
Copy link

@gaearon gaearon commented Mar 4, 2015

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

@bizmurr
Copy link

@bizmurr bizmurr commented Mar 18, 2015

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

@frederickfogerty
Copy link
Contributor

@frederickfogerty 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
Copy link

@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
Copy link

@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
Copy link

@bizmurr bizmurr commented Mar 18, 2015

Ah I see, thanks for the clarification!

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

@goatslacker goatslacker commented Mar 18, 2015

Actually let me open a new ticket.

@goatslacker
Copy link
Owner

@goatslacker goatslacker commented Mar 18, 2015

#85

Killavus added a commit to arkency/react_flux_alt_immutable_todolist that referenced this issue Jul 3, 2015
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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.