Skip to content

Use React-provided stacktrace in crash overlay #1746

Closed
@Timer

Description

@Timer

The recently merged crash overlay should support whitelisted warnings thrown by React.

Currently, this can be accomplished by enabling the console proxy via:

proxyConsole('error');

However, this relies on a synthetically generated stack-trace and not the stack-trace provided by React in the warning. e.g.

    var error = void 0;
    try {
      throw new Error(message);
    } catch (e) {
      error = e;
    }

This is problematic, however, because of how React works.

In React, components aren't rendered recursively, so there's never more than one component's render() on the stack
- @gaearon

This results in an unreconstructed tree of components specifying where the problem is stemming from.


The stack-trace from React is actually already parsed, and used to replace the line references on the synthetically generated stack-trace.

The proper behavior, however, would be to not generate a synthetic stack-trace and rely solely on the stack-trace given by React.

We realize this may be a daunting issue, but if you are up to the challenge, we will answer your every question!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions