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

babel-node: ReactComponentTreeDevtool.js causes ReactDOMServer.renderToString to fail #7350

Closed
ian-speers opened this issue Jul 25, 2016 · 4 comments
Assignees
Milestone

Comments

@ian-speers
Copy link

While following a server-side react tutorial, I encountered a runtime error caused by ReactComponentTreeDevtool. Specifically, the purgeDeep function seems to be problematic under certain conditions (react/lib/ReactComponentTreeDevtool.js line 47):

User Code:

screen shot 2016-07-24 at 3 49 40 pm

screen shot 2016-07-24 at 3 47 01 pm

Stack Trace:

screen shot 2016-07-24 at 3 41 00 pm

Offending Code:

screen shot 2016-07-25 at 8 21 17 am

Resolution: Adding a check for undefined childIDs before the traversal (react/lib/ReactComponentTreeDevtool.js line 47) resolves the issue (see below).

screen shot 2016-07-25 at 8 19 57 am

screen shot 2016-07-24 at 4 02 23 pm

Additional:
OS: OS X Yosemite (10.10.5)
Node: 4.4.7
Run on: babel-node (via babel-cli 6.11.4 )

Let me know if there's any additional information I should provide (e.g. dev dependencies). Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Jul 25, 2016

Can you provide a minimal project reproducing this? Thanks.

@gaearon gaearon self-assigned this Jul 25, 2016
@ian-speers
Copy link
Author

ian-speers commented Jul 25, 2016

React_Issue_7350.zip

I pulled out ./node_modules for size. Just run npm install, then npm start and navigate to localhost:3000 to reproduce (hopefully).

@gaearon
Copy link
Collaborator

gaearon commented Aug 22, 2016

This has been fixed in React 15.3.1.

@gaearon gaearon closed this as completed Aug 22, 2016
@gaearon gaearon added this to the 15.3.1 milestone Aug 22, 2016
@gaearon
Copy link
Collaborator

gaearon commented Aug 22, 2016

(Also, thank you very much for providing a way to reproduce.)

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

No branches or pull requests

3 participants