Expose ssrRewriteStacktrace #7045
Labels
enhancement: pending triage
feat: ssr
p2-nice-to-have
Not breaking anything but nice to have (priority)
Clear and concise description of the problem
In SvelteKit, stack traces are rendered in dev mode on error pages for errors encountered during SSR. These errors could be expected...
...or unexpected:
In the latter case, the error is also logged, before the error page is rendered. This means that we end up calling
ssrFixStacktrace
twice — once when it's logged, and again when it's rendered. But sincessrFixStacktrace
isn't idempotent, the second call should really be calledssrBreakStacktrace
.Suggested solution
We can work around it, allowing us to fix stack traces at render time regardless of whether they were already fixed for logging...
...but it would be neater if instead Vite exposed the internal
ssrRewriteStacktrace
helper, so that we weren't mutating error objects in the first place.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: