React dev tools - Deactivate “break on warnings”

后端 未结 6 2240
说谎
说谎 2021-02-11 11:45

While developing with create-react-app, my browser enters debugger mode on warnings:

It breaks on the source code of react-dev-tools:



        
相关标签:
6条回答
  • 2021-02-11 12:12

    Chrome has a "BlackBox script" feature which is useful in this case.

    1. Go to Chrome Developer tools -> source tab
    2. Select "react_developer_tools.js" from the left pane
    3. Right-click file and select "Blackbox script"

    0 讨论(0)
  • 2021-02-11 12:14

    Go to your ReactDev tools in the tab Debugging and disable "Break on Warning".

    I think this new behavior started today with this new PR: https://github.com/facebook/react/pull/19048

    0 讨论(0)
  • 2021-02-11 12:15

    Go to Chrome Devtools → in the Chrome console, go to Component → Click on Settings → unset Break on Warning. Do the same in ProfilerSettings → unset Break on warning.

    @cadoman pointed check and then uncheck to make work for sure.

    P.S: Image from https://github.com/facebook/react/issues/19308#issuecomment-656669792

    0 讨论(0)
  • 2021-02-11 12:18

    The issue is due to a recent release. A Workaround proposed by the React team is:

    • Go to Chrome Developer Tools
    • Click on the Components Tab (React Developer Tools Extension)
    • Click on the Settings icon (located next to the component search box)
    • Once modal opens select the Debugging tab
    • Finally, double click on the Break on Warnings checkbox (check and unchecked)

    Make sure at last the Break on Warnings checkbox is unchecked.

    Reference: Issue link

    0 讨论(0)
  • 2021-02-11 12:29

    It's a known issue. A workaround is posted on GitHub: Bug: Unexpected debugger statement in DevTools (solved) #19308

    0 讨论(0)
  • 2021-02-11 12:32

    Based on pull request DevTools: Make break-on-warn off by default #19309 it seems it's a bug.

    The Break On Warnings box was unchecked for me and it still would break. Removing and readding the extension to force an update fixed it for me.

    I don't know of another way to force Chrome to update an extension outside of its regular schedule.

    0 讨论(0)
提交回复
热议问题