Skip to content

Completely isolate the error overlay script from the main app #3120

Closed
@gaearon

Description

@gaearon

I’m worried that if we add duplicate React detection (e.g. facebook/react-devtools#714), it will start firing in CRA development mode because react-error-overlay might ship with its own copy of React (e.g. if the app user deletes React but then adds an incompatible version). I’d like to avoid warning in such cases because it is intentional, and the iframe is meant to be completely opaque to the app developer.

I wonder if we can package the error overlay code in a way that it bundles React (rather than just importing it via CommonJS) and executes it in the context of the iframe (e.g. via iframeWindow.eval). Then DevTools shouldn’t “see“ React there.

Does this make any sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions