aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Swithinbank <swithinbank@gmail.com> 2024-05-06 22:02:54 +0200
committerGravatar GitHub <noreply@github.com> 2024-05-06 22:02:54 +0200
commite63e96bf32bce270926da6e65c9a331cf9e462d4 (patch)
tree87f42d011186b2fe33035ec2de7cb7132154850c
parent23fb790f40fa642392092489c79da4fc372c1182 (diff)
downloadastro-e63e96bf32bce270926da6e65c9a331cf9e462d4.tar.gz
astro-e63e96bf32bce270926da6e65c9a331cf9e462d4.tar.zst
astro-e63e96bf32bce270926da6e65c9a331cf9e462d4.zip
Import metric table from astro:db (#10947)
-rw-r--r--.changeset/tough-numbers-build.md5
-rw-r--r--packages/integrations/web-vitals/src/db-config.ts4
-rw-r--r--packages/integrations/web-vitals/src/endpoint.ts4
3 files changed, 9 insertions, 4 deletions
diff --git a/.changeset/tough-numbers-build.md b/.changeset/tough-numbers-build.md
new file mode 100644
index 000000000..fdb7eea33
--- /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 918850f63..b7969b14b 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 10dea1ca8..b0347d7d3 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;