rsnext/packages/next/server/web/sandbox
Damien Simonin Feugas c2b8006485
refactor(middleware): leverages edge-runtime builtins to decorate errors in dev (#37718)
### What's in there?

This is a followup of https://github.com/vercel/next.js/pull/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:

bf7bf8217f/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>
2022-06-17 15:06:30 +00:00
..
context.ts refactor(middleware): leverages edge-runtime builtins to decorate errors in dev (#37718) 2022-06-17 15:06:30 +00:00
index.ts Refactor sandbox module cache (#31822) 2021-11-26 12:06:41 +00:00
sandbox.ts Improve Middleware errors (#37695) 2022-06-14 19:58:13 -05:00