Improve error handling for packages that don't run on the edge #87057
mintydev789
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
Btw, if you are in latest Next.js, the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
This feature is really needed, because right now, if you use one of those packages without realizing it's not supported by edge runtimes, you'll get a very cryptic and unhelpful error message. For example, when I was working with the Pino library, I kept getting an error related to a file not being found, because Pino uses worker threads, which only work with Node. There is currently no intuitive way to figure out that this is caused by the lack of edge runtime support in the package.
Proposal
Implenent a way to detect when the code uses features not supported on the edge, and display an error that instructs the developer that they may be using an unsupported feature (e.g. worker threads, like in my example) and that if it's used in a package, that package must be added to the external packages array in the Next JS config file.
Beta Was this translation helpful? Give feedback.
All reactions