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

Add better errors when referencing missing components #1811

Merged
merged 1 commit into from
Nov 13, 2021
Merged

Add better errors when referencing missing components #1811

merged 1 commit into from
Nov 13, 2021

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented Nov 13, 2021

Previously, React or other JSX runtimes threw rather hard to read errors
when a component was undefined (because it wasn’t imported, passed, or
provided), essentially only pointing to something missing.
Now we throw proper errors when a component is missing at runtime,
including what exact component (or object) is undefined.

In addition, this adds a development option, which defaults to
false but can be configured explicitly or turned on with
NODE_ENV=development.
When it’s true, the exact place that references the missing component
or object, and which file did that, is included in the error message.

Related-to: #1775.
Backports: wooorm/xdm@62e6f30.

Previously, React or other JSX runtimes threw rather hard to read errors
when a component was undefined (because it wasn’t imported, passed, or
provided), essentially only pointing to *something* missing.
Now we throw proper errors when a component is missing at runtime,
including what exact component (or object) is undefined.

In addition, this adds a `development` option, which defaults to
`false` but can be configured explicitly or turned on with
`NODE_ENV=development`.
When it’s `true`, the exact place that references the missing component
or object, and which file did that, is included in the error message.

Related-to: #1775.
Backports: wooorm/xdm@62e6f30.
@vercel

This comment has been minimized.

@codecov-commenter

This comment has been minimized.

@wooorm wooorm merged commit 2f96fba into main Nov 13, 2021
@wooorm wooorm deleted the errors branch November 13, 2021 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants