Skip to content

Error when __source is provided to production build #9832

@sebmarkbage

Description

@sebmarkbage

Currently if the __source transform is enabled together with the production build there are no indicators of a poorly performant configuration. https://facebook.github.io/react/ even has it.

We already check for the existence of a __source field. So we can just reuse the same check to issue something in prod mode if it exists.

The problem is that we don't have any warning module in prod and it is unclear if it would get attention or even considered to spammy in prod.

We could throw but that might be too extreme since a misconfiguration would kill the site.

We could also use this to set a flag on the __REACT_DEVTOOLS_GLOBAL_HOOK__ object. The icon in the devtools extension could use this to indicate a misconfigured build.

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