Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { promises as fs } from "node:fs";
import MagicString from "magic-string";
import { parse as htmlParse } from "node-html-parser";
import { SourceMapConsumer } from "source-map";
import { parse as StackTraceParse } from "stack-trace";
import { codeFrameColumns } from "@babel/code-frame";

import type { Plugin, ResolvedConfig } from "vite";
Expand Down Expand Up @@ -250,8 +249,8 @@ export function PrerenderPlugin({
);
prerender = m.prerender;
} catch (e) {
const stack = StackTraceParse(e as Error).find(s =>
s.getFileName().includes(tmpDir),
const stack = await import("stack-trace").then(({ parse }) =>
parse(e as Error).find(s => s.getFileName().includes(tmpDir)),
);

const isReferenceError = e instanceof ReferenceError;
Expand Down