diff --git a/.changeset/tough-numbers-build.md b/.changeset/tough-numbers-build.md new file mode 100644 index 000000000000..fdb7eea33c28 --- /dev/null +++ b/.changeset/tough-numbers-build.md @@ -0,0 +1,5 @@ +--- +"@astrojs/web-vitals": patch +--- + +Fixes a runtime issue where Vite was unintentionally pulled into the server code diff --git a/packages/integrations/web-vitals/src/db-config.ts b/packages/integrations/web-vitals/src/db-config.ts index 918850f63580..b7969b14bff2 100644 --- a/packages/integrations/web-vitals/src/db-config.ts +++ b/packages/integrations/web-vitals/src/db-config.ts @@ -1,5 +1,5 @@ import { column, defineDb, defineTable } from 'astro:db'; -import { asDrizzleTable } from '@astrojs/db/utils'; +// import { asDrizzleTable } from '@astrojs/db/utils'; const Metric = defineTable({ columns: { @@ -13,7 +13,7 @@ const Metric = defineTable({ }, }); -export const AstrojsWebVitals_Metric = asDrizzleTable('AstrojsWebVitals_Metric', Metric); +// export const AstrojsWebVitals_Metric = asDrizzleTable('AstrojsWebVitals_Metric', Metric); export default defineDb({ tables: { diff --git a/packages/integrations/web-vitals/src/endpoint.ts b/packages/integrations/web-vitals/src/endpoint.ts index 10dea1ca88aa..b0347d7d30c4 100644 --- a/packages/integrations/web-vitals/src/endpoint.ts +++ b/packages/integrations/web-vitals/src/endpoint.ts @@ -1,6 +1,6 @@ -import { db, sql } from 'astro:db'; +// @ts-expect-error — AstrojsWebVitals requires type-gen which we can’t use. +import { db, sql, AstrojsWebVitals_Metric } from 'astro:db'; import type { APIRoute } from 'astro'; -import { AstrojsWebVitals_Metric } from './db-config.js'; import { ServerMetricSchema } from './schemas.js'; export const prerender = false;