T3env: Module not found: Can't resolve '@/env.mjs'

Hi, I am trying to use T3env for the first time but i keep getting this error in build Module not found: Can't resolve '@/env.mjs'. My env.mjs is in my src folder. here is my env.mjs file:
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';

export const env = createEnv({
server: {
DATABASE_URL: z.string().url(),
OPEN_AI_API_KEY: z.string().min(1),
OPEN_AI_ORGANIZATION_ID: z.string().min(1),
BITLY_ACCESS_TOKEN: z.string().min(1),
PASSWORD: z.string().min(1),
CLERK_SECRET_KEY: z.string().min(1),
WEBHOOK_SECRET: z.string().min(1),
RESEND_API_KEY: z.string().min(1),
},
client: {
NEXT_PUBLIC_LOCAL_URL: z.string().url(),
NEXT_PUBLIC_VERCEL_URL: z.string().url(),
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
},
experimental__runtimeEnv: {
NEXT_PUBLIC_LOCAL_URL: process.env.NEXT_PUBLIC_LOCAL_URL,
NEXT_PUBLIC_VERCEL_URL: process.env.NEXT_PUBLIC_VERCEL_URL,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
},
});
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';

export const env = createEnv({
server: {
DATABASE_URL: z.string().url(),
OPEN_AI_API_KEY: z.string().min(1),
OPEN_AI_ORGANIZATION_ID: z.string().min(1),
BITLY_ACCESS_TOKEN: z.string().min(1),
PASSWORD: z.string().min(1),
CLERK_SECRET_KEY: z.string().min(1),
WEBHOOK_SECRET: z.string().min(1),
RESEND_API_KEY: z.string().min(1),
},
client: {
NEXT_PUBLIC_LOCAL_URL: z.string().url(),
NEXT_PUBLIC_VERCEL_URL: z.string().url(),
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
},
experimental__runtimeEnv: {
NEXT_PUBLIC_LOCAL_URL: process.env.NEXT_PUBLIC_LOCAL_URL,
NEXT_PUBLIC_VERCEL_URL: process.env.NEXT_PUBLIC_VERCEL_URL,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
},
});
Very confused, since ive followed the documentation exactly aside from including import "./src/env.mjs"; in my next.config.js since I can't use imports outside of a module
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server