-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Document how to self-diagnose unminified/development build results #692
Comments
Great, I agree this is useful. Where do you think would be the best place to put it? |
Hi @ngyikp, Thank you for the guide! One may face confusing behavior. For example, iamdustan.com uses React. DevTools say it's production.
Though, if we follow Dan's way from Console Input
Output
|
@gaearon Write something like:
@chisler In this case, React Dev Tools is correct about production mode and Chrome devtools is being misleading, I'll update my first comment to mention disabling source maps temporarily. |
Thanks for the good spot! It's great that guide is updated. |
React DevTools has been rewritten and recently launched a new version 4 UI. The source code for this rewrite was done in a separate repository and now lives in the main React repo (github.com/facebook/react). Because version 4 was a total rewrite, and all issues in this repository are related to the old version 3 of the extension, I am closing all issues in this repository. If you can still reproduce this issue, or believe this feature request is still relevant, please open a new issue in the React repo: https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools |
Many new bug reports are related to the detection of unminified/development builds and surprised at the results. It would be great to have a document on how to self-diagnose this and confirm the results.
I made a demo test suite with various conditions: https://github.com/ngyikp/react-devtools-minification-diagnosis
Diagnosis:
Temporarily turn off JavaScript source maps or else you might see confusing results
Run
window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers
in the consoleEnsure there is only one renderer, if there are more than one, then React is being loaded twice
(I think there should be another bug report open to track this edge case)(bug opened, see Detect duplicate React and show a different message #700)Expand the renderer and
Mount
, right-click_renderNewRootComponent
and click Show Function Definition(instructions are slightly different for Fiber)
The ideal minified production build should look like this: (you should probably pretty print it)
The text was updated successfully, but these errors were encountered: