-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(middleware): leverages edge-runtime builtins to decorate err…
…ors in dev (#37718) ### What's in there? This is a followup of #37695. For the dev server to clean stacktraces, we're decorating errors caught during code evaluation (`getServerSideProps` or middleware). However, when these errors are asynchronously raised, we can't decorate them before processing them, leading to this fallback logic: https://github.com/vercel/next.js/blob/bf7bf8217f0d3df37d740a0cebf2f140e9c518b6/packages/next/server/dev/next-dev-server.ts#L775-L779 Thanks to latest improvement of the edge-runtime in 1.1.0-beta.4, we can now catch unhandled rejection and uncaught exception, and decorate them. ### How to test? Please reuse the existing tests who already covered these cases: `pnpm testheadless --testPathPattern middleware-dev-errors` Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
648 additions
and
608 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
1,094 changes: 557 additions & 537 deletions
1,094
packages/next/compiled/@edge-runtime/primitives/index.js
100755 → 100644
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"@edge-runtime/primitives","version":"1.1.0-beta.2","main":"./index.js","license":"MPLv2"} | ||
{"name":"@edge-runtime/primitives","version":"1.1.0-beta.6","main":"./index.js","license":"MPLv2"} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.