Skip to content

Commit 871ed73

Browse files
committed
guard against missing version export
1 parent cc1f8ee commit 871ed73

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/vite-plugin/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
22
import { _rollupPluginInternal } from "@sentry/rollup-plugin";
3-
import { Plugin, version } from "vite";
3+
import vite, { Plugin } from "vite";
44

55
function getViteMajorVersion(): string | undefined {
66
try {
7-
return version?.split(".")[0];
7+
// The version export was only added in Vite v3?
8+
return vite?.version?.split(".")[0];
89
} catch (err) {
910
// do nothing, we'll just not report a version
1011
}

0 commit comments

Comments
 (0)