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

Created on 25 Jul 2016  ·  4Comments  ·  Source: facebook/react

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!

DOM Bug

Most helpful comment

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

All 4 comments

Can you provide a minimal project reproducing this? Thanks.

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).

This has been fixed in React 15.3.1.

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

Was this page helpful?
0 / 5 - 0 ratings