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

[Dev Tools] Chrome component console errors get output from "backend.js" #16649

Closed
natew opened this issue Sep 3, 2019 · 7 comments
Closed

Comments

@natew
Copy link

natew commented Sep 3, 2019

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When I get a component stack trace, the log trace comes from the dev tools extension:

image

What is the expected behavior?

I use that trace usually to click and set a debugger so I can debug some React internals.

@gaearon
Copy link
Collaborator

gaearon commented Sep 3, 2019

Click on the message and the arrow on the left should expand. It gives you the JS stack.

@natew
Copy link
Author

natew commented Sep 4, 2019

Yea, just wondered if this was intentional or avoidable, I believe without extension you get that two steps faster. Not a big one.

@bvaughn
Copy link
Contributor

bvaughn commented Sep 4, 2019

This is how DevTools injects "component stacks" for errors and warnings. (Check out the "Component Stacks" blurb from the changelog.)


Component stacks

React component authors have often requested a way to log warnings that include the React "component stack". DevTools now provides an option to automatically append this information to warnings (console.warn) and errors (console.error).

Example console warning with component stack added

It can be disabled in the general settings panel:

Settings panel showing "component stacks" option


You can turn this off in Settings if the override is getting in the way 😄 I understand the reported location is kind of an annoying quirk.

We've started a dialog about ways that we could perhaps implement this sort of functionality in a less invasive way but the conversation is ongoing: whatwg/console#163


I'm going to close this issue since it's a question and it's been answered. Happy to keep talking though if there's follow up.

@natew
Copy link
Author

natew commented Sep 4, 2019 via email

@vdh
Copy link

vdh commented Mar 24, 2020

This also has the very nasty side effect of causing the Chrome dev tools to hang if you try to put in a breakpoint to find out where exactly this error comes from, because the backend.js is (now?) minified 😢

Maybe include source maps for backend.js if the console stack traces are going to get hijacked?

@bvaughn
Copy link
Contributor

bvaughn commented Mar 24, 2020

I'm not sure I understand - backend.js has always been minified.

Either way, a minified JavaScript file should not cause Chrome to hang on a breakpoint.

@vdh
Copy link

vdh commented Mar 25, 2020

@bvaughn It does if for example you put a breakpoint on line 6 and that minified line contains the entire contents of the file.

It's a known issue with Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=593679

Normally it can be avoided by not attempting to debug minified code, but that's hard when this code injects into the stack trace.

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

4 participants