vite-plugins
vite-plugins copied to clipboard
Expose ssrFixStacktrace to application
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.