React dev tools - Deactivate "break on warnings"
Asked Answered
P

6

89

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

Paused in debugger

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

   // --- Welcome to debugging with React DevTools ---
   // This debugger statement means that you've enabled the "break on warnings" feature.
   // Use the browser's Call Stack panel to step out of this override function-
   // to where the original warning or error was logged.

How can I deactivate this behavior?

Persiflage answered 10/7, 2020 at 13:52 Comment(3)
This behavior is totally annoying. I really would like to know how to disable itTranscribe
here is a step by step instruction by Dan github.com/facebook/react/issues/19308#issuecomment-656682924 to remove this behavior for nowPerceptive
My solution was to blackbox that particular file so the debugger skips it entirely. Unless you're developing that plugin you should be good to do that.Laurustinus
H
86

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

Enter image description here

Hollar answered 10/7, 2020 at 14:11 Comment(3)
And you need to check then uncheck if it is not already checkedPersiflage
There also seems to be a bug where the checkbox is getting confused between the Profiler and the Component settings. Check or uncheck on one, then the other shows the last value. So as cadoman said, just check and uncheck.Mackenzie
haaa, I found you :)Mullane
W
16

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.

Werner answered 10/7, 2020 at 14:9 Comment(0)
B
5

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

Bahaism answered 10/7, 2020 at 14:9 Comment(0)
T
4

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

Enter image description here

Topping answered 11/7, 2020 at 8:22 Comment(0)
W
3

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

Washedup answered 10/7, 2020 at 14:9 Comment(0)
S
3

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"

enter image description here

Stephanestephani answered 12/7, 2020 at 17:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.