t3-oss / t3-env

https://env.t3.gg
MIT License
2.45k stars 79 forks source link

Type Error: Type instatiation is excessively deep and possibly infinite #214

Closed Manokii closed 2 months ago

Manokii commented 2 months ago

Was wondering why typescript was very slow, then I saw this. 240410_19h23m59s_screenshot

Versions:

Code Snippet

import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
  server: {
    SECRET: z.string().min(1),
  },
  client: {},
});
Manokii commented 2 months ago

nvm, closing this, worked fine when i changed moduleResolution to NodeNext in tsconfig. It's just skill issue

mwawrusch commented 2 months ago

I ran into this too. We use bundler for moduleResolution (and can't change that). Happened when upgrading to the latest and greatest zod/t3-env

AveshLutchman commented 2 months ago

I have the same issue, using ModuleResolution as bundler, I have the latest zod + t3-env as well.