Skip to content

Commit 96151fd

Browse files
yethikrishnaclaude
andcommitted
fix: resolve CLI backend URL and Vercel deployment issues
- Replace non-existent levelcode.ai domain with levelcode.vercel.app in env defaults, schema, and error handling fallback URL - Add @opentelemetry/api to serverExternalPackages to fix ENOENT during Vercel output tracing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8e12d95 commit 96151fd

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

cli/src/utils/error-handling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { env } from '@levelcode/common/env'
22

33
import type { ChatMessage } from '../types/chat'
44

5-
const defaultAppUrl = env.NEXT_PUBLIC_LEVELCODE_APP_URL || 'https://levelcode.com'
5+
const defaultAppUrl = env.NEXT_PUBLIC_LEVELCODE_APP_URL || 'https://levelcode.vercel.app'
66

77
// Normalize unknown errors to a user-facing string.
88
const extractErrorMessage = (error: unknown, fallback: string): string => {

common/src/env-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const CLIENT_ENV_PREFIX = 'NEXT_PUBLIC_'
44

55
export const clientEnvSchema = z.object({
66
NEXT_PUBLIC_CB_ENVIRONMENT: z.enum(['dev', 'test', 'prod']).default('prod'),
7-
NEXT_PUBLIC_LEVELCODE_APP_URL: z.string().default(''),
7+
NEXT_PUBLIC_LEVELCODE_APP_URL: z.string().default('https://levelcode.vercel.app'),
88
NEXT_PUBLIC_SUPPORT_EMAIL: z.string().default('support@levelcode.ai'),
99
NEXT_PUBLIC_POSTHOG_API_KEY: z.string().default(''),
1010
NEXT_PUBLIC_POSTHOG_HOST_URL: z.string().default('https://app.posthog.com'),

common/src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const parsedEnv = clientEnvSchema.safeParse(clientProcessEnv)
55
// Provide fallback values for CLI usage where env vars may not be set
66
const fallbackEnv = {
77
NEXT_PUBLIC_CB_ENVIRONMENT: 'prod' as const,
8-
NEXT_PUBLIC_LEVELCODE_APP_URL: '',
8+
NEXT_PUBLIC_LEVELCODE_APP_URL: 'https://levelcode.vercel.app',
99
NEXT_PUBLIC_SUPPORT_EMAIL: 'support@levelcode.ai',
1010
NEXT_PUBLIC_POSTHOG_API_KEY: '',
1111
NEXT_PUBLIC_POSTHOG_HOST_URL: 'https://app.posthog.com',

web/next.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const nextConfig = {
2323
},
2424
allowedDevOrigins: DEV_ALLOWED_ORIGINS,
2525

26+
// Externalize packages that cause ENOENT during Vercel output tracing
27+
serverExternalPackages: ['@opentelemetry/api'],
28+
2629
// Enable experimental features for better SSG performance
2730
experimental: {
2831
optimizePackageImports: ['@/components/ui'],

0 commit comments

Comments
 (0)