Skip to content

logCapturedError ate our error message #16605

@Jack-Works

Description

@Jack-Works

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

What is the current behavior?
image

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

Our application is run in a very complicated environment. It's hard to do that.

What is the expected behavior?
I change the bundled file, add console.error(error) in logCapturedError

And the correct error and it's stack is printed.

image

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
I'm debugging in Firefox Developement Edition. And the code is running in the WebExtension environment. Please consider if the following code is correct in Firefox

// Browsers support silencing uncaught errors by calling
    // `preventDefault()` in window `error` handler.
    // We record this information as an expando on the error.

    if (error != null && error._suppressLogging) {
      if (errorBoundaryFound && willRetry) {
        // The error is recoverable and was silenced.
        // Ignore it and don't print the stack addendum.
        // This is handy for testing error boundaries without noise.
        return;
      }
      // The error is fatal. Since the silencing might have
      // been accidental, we'll surface it anyway.
      // However, the browser would have silenced the original error
      // so we'll print it first, and then print the stack addendum.
      console.error(error);
      // For a more detailed description of this block, see:
      // https://github.com/facebook/react/pull/13384
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions