t3-oss / t3-env

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

Cannot find module '@t3-oss/env-nextjs' #211

Closed CarlosZiegler closed 3 months ago

CarlosZiegler commented 3 months ago

@juliusmarminge Sorry for delay, a lot do do, here is the current status from the error and a link to reproduce it.

Reference ISSUE: #189

Error:

Type error: Cannot find module '@t3-oss/env-nextjs' or its corresponding type declarations.
web-app:build:   There are types at '/Users/carlosziegler/zietec/saas-supabase-template/packages/env/node_modules/@t3-oss/env-nextjs/dist/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

Screenshot :

image

Link: https://github.com/CarlosZiegler/monorepo-template Please uncomment @ts-ignore in packages/env/index.ts to get same error on BUILD

juliusmarminge commented 3 months ago

env pacakge works: CleanShot 2024-03-22 at 10 54 58@2x

the reason you get build errors during build is that your nextjs doesn't use a compatible module resolution:

CleanShot 2024-03-22 at 10 56 44@2x

after fixing that it "works" but i get new errors since you're referencing variables that doesn't exist on the env object:

CleanShot 2024-03-22 at 10 57 49@2x


https://github.com/CarlosZiegler/monorepo-template/pull/6

CarlosZiegler commented 3 months ago

Thanks, I dont understand how I cant got that :) Some times as changes, but maybe wrong place. I dont know :( About variables, yes I pushed fast and missing to add it, sorry.

Thanks a lot :)