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

react-hot-loader error #2

Closed
ghost opened this issue Nov 23, 2014 · 12 comments
Closed

react-hot-loader error #2

ghost opened this issue Nov 23, 2014 · 12 comments

Comments

@ghost
Copy link

ghost commented Nov 23, 2014

when i change anything in app.js, i get this error in the browser console:

"Cannot not apply hot update to app.js: Found duplicate displayName in Morearty.js: "Bootstrap".
react-hot-loader uses displayName to distinguish between several components in one file."

@Tvaroh
Copy link
Member

Tvaroh commented Nov 23, 2014

Hello. I can't reproduce the issue. Try git pull followed by npm update. Let me now if the problem persists.

@ghost
Copy link
Author

ghost commented Nov 23, 2014

still the same error after running those commands. let me know if you have any ideas on how to troubleshoot this. thanks.

@Tvaroh
Copy link
Member

Tvaroh commented Nov 24, 2014

Can you try to reproduce on fresh checkout or even on a different machine?

@ghost
Copy link
Author

ghost commented Nov 24, 2014

i actually did this yesterday, with the same error (fresh VM, installed git/node/npm, checked out the repo). I'm not sure what I could be doing wrong? It wasn't quite as simple as "npm run start". I believe I had to do "npm install webpack -g" and "npm update" before "npm run start" would work.

I also tried installing the "react-hot-boilerplate" template, and tweaked that to use the same dependencies as todomvc-moreartyjs. Hot update was working without error until I added Morearty and the code in the todomvc-moreartyjs "app.js" file, and then I started getting the error about "duplicate displayName".

@ghost
Copy link
Author

ghost commented Nov 26, 2014

have you been able to reproduce this? i tried again with a clean linux VM today and ended up with the same error message.

@mbektimirov
Copy link
Member

I cloned the the repo from scratch and started the app without problems. Try to pull again, I've updated Immutable version.

@ghost
Copy link
Author

ghost commented Nov 26, 2014

thanks for taking a look. i cloned from scratch and i'm still seeing the same error. note that i also can start the app without any problem. i'm only seeing the error in the browser console when i make a change to "app.js" and save the file.

@ghost
Copy link
Author

ghost commented Nov 29, 2014

have you been able to reproduce the issue when saving changes to "app.js"? if not, any ideas what i could be doing wrong?

@mbektimirov
Copy link
Member

Yep, I've reproduced it. Try to inject Bootstrap component without jsx.
I'll push my changes later to fix this
29 нояб. 2014 г. 11:28 пользователь "jack-james" notifications@github.com
написал:

have you been able to reproduce the issue when saving changes to "app.js"?
if not, any ideas what i could be doing wrong?


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

@ghost
Copy link
Author

ghost commented Dec 7, 2014

i'm not able to work around this. much appreciated if you can push a fix or provide more detailed instructions for a workaround. thanks.

mbektimirov added a commit that referenced this issue Dec 7, 2014
@mbektimirov
Copy link
Member

Ok, the fix is here. I put the Bootstrap wrapper in the separate module to prevent it creation on each app.jsx reload. Now you can use hot-loader with jsx, but it won't reload the app if you change a state directly in your code. Let me know if this helped you.

@ghost
Copy link
Author

ghost commented Dec 9, 2014

yes, this resolved the issue. thanks, much appreciated.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants