Trevor
Trevor
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
really appreciate your help thanks : D
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
not all heroes wear capes nyx
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
so maybe this will be useful if someone else comes along that
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
btw you were also right that i needed to run the command with bunx
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
i shall leave this question up so that future generations can witness my shame
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
lmao, thank you so much, it turns out i am dumb
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
🤦‍♂️
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
g.
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
m.
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
o.
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';

export const env = createEnv({
server: {
CLERK_SECRET_KEY: z.string(),
PLANETSCALE_DB: z.string(),
PLANETSCALE_DB_CERT_PATH: z.string(),
PLANETSCALE_DB_HOST: z.string(),
PLANETSCALE_DB_USERNAME: z.string(),
PLANETSCALE_DB_PASSWORD: z.string(),
PLANETSCALE_DB_URL: z.string(),
},
client: {
NEXT_PUBLIC_CLERK_SIGN_IN_URL: z.string(),
NEXT_PUBLIC_CLERK_SIGN_UP_URL: z.string(),
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: z.string(),
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string(),
},
// For Next.js >= 13.4.4, you only need to destructure client variables:
experimental__runtimeEnv: {
NEXT_PUBLIC_CLERK_SIGN_IN_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL,
NEXT_PUBLIC_CLERK_SIGN_UP_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL,
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: process.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: process.env.NEXT_PUBLIC_PUBLISHABLE_KEY,
},
});
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';

export const env = createEnv({
server: {
CLERK_SECRET_KEY: z.string(),
PLANETSCALE_DB: z.string(),
PLANETSCALE_DB_CERT_PATH: z.string(),
PLANETSCALE_DB_HOST: z.string(),
PLANETSCALE_DB_USERNAME: z.string(),
PLANETSCALE_DB_PASSWORD: z.string(),
PLANETSCALE_DB_URL: z.string(),
},
client: {
NEXT_PUBLIC_CLERK_SIGN_IN_URL: z.string(),
NEXT_PUBLIC_CLERK_SIGN_UP_URL: z.string(),
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: z.string(),
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string(),
},
// For Next.js >= 13.4.4, you only need to destructure client variables:
experimental__runtimeEnv: {
NEXT_PUBLIC_CLERK_SIGN_IN_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL,
NEXT_PUBLIC_CLERK_SIGN_UP_URL: process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL,
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: process.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: process.env.NEXT_PUBLIC_PUBLISHABLE_KEY,
},
});
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
yeah they're all in there
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
gotcha
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
I'm not sure what you mean by this, you mean in the env.ts file where i'm invoking createEnv?
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
good eye though lol, sorry i let you bark up that tree, lemme edit that message
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
that was badly misleading, i did already fix that
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
sorry
49 replies
TTCTheo's Typesafe Cult
Created by Trevor on 7/2/2023 in #questions
env-nextjs not able to find .env variables
CLERK_SECRET_KEY=***

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=***
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/

PLANETSCALE_DB=***
PLANETSCALE_DB_CERT_PATH=***

PLANETSCALE_DB_HOST=***
PLANETSCALE_DB_USERNAME=***
PLANETSCALE_DB_PASSWORD=***

PLANETSCALE_DB_URL=***
CLERK_SECRET_KEY=***

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=***
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/

PLANETSCALE_DB=***
PLANETSCALE_DB_CERT_PATH=***

PLANETSCALE_DB_HOST=***
PLANETSCALE_DB_USERNAME=***
PLANETSCALE_DB_PASSWORD=***

PLANETSCALE_DB_URL=***
This is the .env.local file btw, obviously with the sensitive values taken out, not sure if that helps
49 replies