-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add better errors when referencing missing components (#1811)
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.
- Loading branch information
Showing
12 changed files
with
415 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const development = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import process from 'node:process' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ChristianMurphy
Member
|
||
|
||
export const development = process.env.NODE_ENV === 'development' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1 comment
on commit 2f96fba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
I'm not familiar with this syntax. Why is this needed? esbuild is throwing compilation errors on my end because it can't resolve this module