t3-oss / t3-env

https://env.t3.gg
MIT License
2.67k stars 86 forks source link

Installation steps do not work for net new Next.js Apps #213

Closed dannyrb closed 5 months ago

dannyrb commented 6 months ago

I found the two sets of documentation above, and attempted to follow each of them in a net new next.js project with Typescript. Here are some issues I encountered:

juliusmarminge commented 5 months ago

Module syntax is based on you having package.json#type set to module. If you don't have that then you need to use the .mjs extension. This is true for any javascript file so I don't see why we should make this clear in our docs.

Validating schema on build is done by importing the env file into your next config as shown here: https://env.t3.gg/docs/nextjs#validate-schema-on-build-(recommended)

Checkout our example if you wanna see more details: https://github.com/t3-oss/t3-env/tree/main/examples/nextjs