Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose ssrRewriteStacktrace #7091

Merged
merged 1 commit into from Mar 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/vite/src/node/server/index.ts
Expand Up @@ -226,7 +226,11 @@ export interface ViteDevServer {
*/
ssrLoadModule(url: string): Promise<Record<string, any>>
/**
* Fix ssr error stacktrace
* Returns a fixed version of the given stack
*/
ssrRewriteStacktrace(stack: string): string
/**
* Mutates the given SSR error by rewriting the stacktrace
*/
ssrFixStacktrace(e: Error): void
/**
Expand Down Expand Up @@ -376,6 +380,9 @@ export async function createServer(
rebindErrorStacktrace(e, stacktrace)
}
},
ssrRewriteStacktrace(stack: string) {
return ssrRewriteStacktrace(stack, moduleGraph)
},
listen(port?: number, isRestart?: boolean) {
return startServer(server, port, isRestart)
},
Expand Down