File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import { promises as fs } from "node:fs";
4
4
import MagicString from "magic-string" ;
5
5
import { parse as htmlParse } from "node-html-parser" ;
6
6
import { SourceMapConsumer } from "source-map" ;
7
- import { parse as StackTraceParse } from "stack-trace" ;
8
7
import { codeFrameColumns } from "@babel/code-frame" ;
9
8
10
9
import type { Plugin , ResolvedConfig } from "vite" ;
@@ -250,8 +249,8 @@ export function PrerenderPlugin({
250
249
) ;
251
250
prerender = m . prerender ;
252
251
} catch ( e ) {
253
- const stack = StackTraceParse ( e as Error ) . find ( s =>
254
- s . getFileName ( ) . includes ( tmpDir ) ,
252
+ const stack = await import ( "stack-trace" ) . then ( ( { parse } ) =>
253
+ parse ( e as Error ) . find ( s => s . getFileName ( ) . includes ( tmpDir ) ) ,
255
254
) ;
256
255
257
256
const isReferenceError = e instanceof ReferenceError ;
You can’t perform that action at this time.
0 commit comments