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

getRootIDs is not defined in ReactComponentTreeHook.js #8318

Closed
tomcardoso opened this issue Nov 16, 2016 · 6 comments · Fixed by #8380
Closed

getRootIDs is not defined in ReactComponentTreeHook.js #8318

tomcardoso opened this issue Nov 16, 2016 · 6 comments · Fixed by #8380

Comments

@tomcardoso
Copy link

tomcardoso commented Nov 16, 2016

Just started running into this bug today, everything was going smoothly before then. Only started happening after I updated to 15.4.0.

When I do import React from 'react';, this error gets thrown on the page when I try to use ReactDOM to render something to the DOM. Here's my code:

import React from 'react';
import ReactDOM from 'react-dom';
import App from './main/App';

ReactDOM.render(<App />, document.querySelector('.wrapper'));

I'm using React 15.4.0 and ReactDom 15.4.0, and bundling everything with Rollup and Buble.

Here's a screenshot of what Chrome tells me is happening:

@gaearon
Copy link
Collaborator

gaearon commented Nov 16, 2016

Can you reproduce this without Rollup?

@tomcardoso
Copy link
Author

Not easily — I'm not sure I know of any code playgrounds that do ES6-style module imports… Any ideas?

FWIW, this (obviously) works: https://jsfiddle.net/yvoy2g3x/

It's very possible that this is some side-effect of ES6-style module bundling. I tried replacing Buble with Babel, same problem.

@gaearon
Copy link
Collaborator

gaearon commented Nov 17, 2016

Might be a Rollup bug then?

@jbt
Copy link

jbt commented Nov 17, 2016

I'm seeing this too with rollup, I believe it's a rollup bug trimming too much code from the output - I opened rollup/rollup#1113 over there for the same issue

@tomcardoso
Copy link
Author

Ah, sweet. Closing, then.

LinusU added a commit to LinusU/react that referenced this issue Nov 22, 2016
Only declare the variable once in this scope, instead of declaring them multiple times in the same scope.

This fixes facebook#8318, even though it might technically be a shortcoming in Rollup.
@LinusU
Copy link
Contributor

LinusU commented Nov 22, 2016

This could be fixed here as well though, declaring the same variable multiple times in the same scope doesn't seem that clean...

Fix here: #8380 :)

gaearon pushed a commit that referenced this issue Nov 22, 2016
Only declare the variable once in this scope, instead of declaring them multiple times in the same scope.

This fixes #8318, even though it might technically be a shortcoming in Rollup.
acusti pushed a commit to brandcast/react that referenced this issue Mar 15, 2017
Only declare the variable once in this scope, instead of declaring them multiple times in the same scope.

This fixes facebook#8318, even though it might technically be a shortcoming in Rollup.
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

Successfully merging a pull request may close this issue.

4 participants