vite-plugins icon indicating copy to clipboard operation
vite-plugins copied to clipboard

Expose ssrFixStacktrace to application

Open cendyne opened this issue 1 year ago • 0 comments

When an application uses an onError handler, the stack trace lines are incorrect. This is typically remedied with vite.ssrFixStacktrace, however as the vite server (https://github.com/honojs/vite-plugins/blob/main/packages/dev-server/src/dev-server.ts#L67) is not passed through the environment or context, it seems unreachable within an application hono handler.

If I throw it again from the onError handler, the vite dev server picks it up and gives an error response with the correct line numbers, suggesting that ssrFixStacktrace works when applied.

cendyne avatar Oct 13 '24 16:10 cendyne