fix build

This commit is contained in:
bkellam 2025-03-18 10:33:56 -07:00
parent 600cefbbd8
commit 98ec2c99bb
2 changed files with 4 additions and 8 deletions

View file

@ -1,6 +1,5 @@
await import("./src/env.mjs");
import { withSentryConfig } from "@sentry/nextjs";
import { env } from "./src/env.mjs";
/** @type {import('next').NextConfig} */
@ -16,15 +15,15 @@ const nextConfig = {
return [
{
source: "/ingest/static/:path*",
destination: `${env.NEXT_PUBLIC_POSTHOG_ASSET_HOST}/static/:path*`,
destination: `https://us-assets.i.posthog.com/static/:path*`,
},
{
source: "/ingest/:path*",
destination: `${env.NEXT_PUBLIC_POSTHOG_HOST}/:path*`,
destination: `https://us.i.posthog.com/:path*`,
},
{
source: "/ingest/decide",
destination: `${env.NEXT_PUBLIC_POSTHOG_HOST}/decide`,
destination: `https://us.i.posthog.com/decide`,
},
];
},

View file

@ -31,14 +31,13 @@ export const env = createEnv({
SOURCEBOT_ROOT_DOMAIN: z.string().default("localhost:3000"),
NODE_ENV: z.enum(["development", "test", "production"]),
SOURCEBOT_TELEMETRY_DISABLED: z.enum(["true", "false"]).default("false"),
DATABASE_URL: z.string().url(),
},
// @NOTE: Make sure you destructure all client variables in the
// `experimental__runtimeEnv` block below.
client: {
// PostHog
NEXT_PUBLIC_POSTHOG_PAPIK: z.string().optional(),
NEXT_PUBLIC_POSTHOG_HOST: z.string().url().default('https://us.i.posthog.com'),
NEXT_PUBLIC_POSTHOG_ASSET_HOST: z.string().url().default('https://us-assets.i.posthog.com'),
NEXT_PUBLIC_POSTHOG_UI_HOST: z.string().url().default('https://us.posthog.com'),
// Misc
@ -48,8 +47,6 @@ export const env = createEnv({
// For Next.js >= 13.4.4, you only need to destructure client variables:
experimental__runtimeEnv: {
NEXT_PUBLIC_POSTHOG_PAPIK: process.env.NEXT_PUBLIC_POSTHOG_PAPIK,
NEXT_PUBLIC_POSTHOG_HOST: process.env.NEXT_PUBLIC_POSTHOG_HOST,
NEXT_PUBLIC_POSTHOG_ASSET_HOST: process.env.NEXT_PUBLIC_POSTHOG_ASSET_HOST,
NEXT_PUBLIC_POSTHOG_UI_HOST: process.env.NEXT_PUBLIC_POSTHOG_UI_HOST,
NEXT_PUBLIC_SOURCEBOT_VERSION: process.env.NEXT_PUBLIC_SOURCEBOT_VERSION,
NEXT_PUBLIC_POLLING_INTERVAL_MS: process.env.NEXT_PUBLIC_POLLING_INTERVAL_MS,