Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to override presets? #322

Open
mxkaske opened this issue Feb 17, 2025 · 0 comments
Open

How to override presets? #322

mxkaske opened this issue Feb 17, 2025 · 0 comments

Comments

@mxkaske
Copy link

mxkaske commented Feb 17, 2025

With the possibility to define your own Deployment Environments dropped last December, vercel will change the default VERCEL_ENV to whatever you named the environment - e.g. VERCEL_ENV="sandbox". This will invalidate the vercel() presets.

Is there a way to extend or override the presets?

export const env = createEnv({
  extends: [vercel()],
  server: {
    VERCEL_ENV: z.enum(["development", "preview", "production", "sandbox"]),
  },
  runtimeEnv: {
    VERCEL_ENV: process.env.VERCEL_ENV
  }
});

I can see it is due to the vercel = () => createEnv({...}) initialized before users definition. Maybe it is possible to only validate the entire object once.

Thanks anyways that nice package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant