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

duplicate react in bundle ? #394

Closed
revolunet opened this issue Dec 15, 2016 · 7 comments
Closed

duplicate react in bundle ? #394

revolunet opened this issue Dec 15, 2016 · 7 comments
Assignees

Comments

@revolunet
Copy link

revolunet commented Dec 15, 2016

Hi,

Looks like a basic next.js project gets react duplicated in the next-dev.bundle.js.
when launching my fresh project, and going to http://127.0.0.1:3000/_next/next-dev.bundle.js i can see two SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED in the source, and i guess this is not good ?

it doesnt hurt for simple cases, but as soon as you use ReactCSSTransitionGroup or something using React refs then you get that error :

next-dev.bundle.js:945 Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).(…)

PS: using next.js@1.2.3

@revolunet
Copy link
Author

trying to debug that from the source :)

cat ./dist/client/next-dev.bundle.js  | grep _FIRED
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

@revolunet
Copy link
Author

Not really sure this is related but i still have a weird bug with ReactCSSTransitionGroup

next-dev.bundle.js:945 Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).(…)

Here's a repro : https://github.com/revolunet/next-issue-394

@arunoda
Copy link
Contributor

arunoda commented Dec 15, 2016

Okay. It seems like you are using a React addon.
I think we had an issue with that. See: #204

@revolunet
Copy link
Author

how did i missed that...thanks.

@arunoda
Copy link
Contributor

arunoda commented Dec 16, 2016

Hey @revolunet could you try this PR: #401

@arunoda
Copy link
Contributor

arunoda commented Dec 16, 2016

I hope #401 fixes this. If not reopen and tell me what went wrong.

@arunoda arunoda closed this as completed Dec 16, 2016
@revolunet
Copy link
Author

#401 fixed it, great job thanks 👍

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants