Comments (20)
Try:
import { createEnv } from "@t3-oss/env-nextjs/dist";
import { createEnv } from "@t3-oss/env-core/dist";
from t3-env.
Thank you for the reproduction repo @ryota-murakami - so much easier to help then :)
This line is the issue: https://github.com/ryota-murakami/guestbook/blob/main/tsconfig.json#L13. Update that to use Bundler
module resolution which supports reading package.json#exports
conditions.
For some good and modern tsconfig presets:
- Matt's tsconfig recommendation: https://www.totaltypescript.com/tsconfig-cheat-sheet
- create-next-app has also started using a more modern tsconfig lately: https://github.com/vercel/next.js/blob/canary/packages/create-next-app/templates/app/ts/tsconfig.json
- and ofc create-t3-app https://github.com/t3-oss/create-t3-app/blob/main/cli/template/base/tsconfig.json
from t3-env.
Downgrading to v0.9.1 fixes the issue.
from t3-env.
This is reproduction repo.
https://github.com/ryota-murakami/guestbook
from t3-env.
Thank you all! I will provide a reproducible next time :)
from t3-env.
related issue: #168
from t3-env.
Needs reproduction repo. Likely a tsconfig option you have that doesnt support esm packages.
0.9 was a breaking change and we now only support esm + modern module resolutions (Node16+)
from t3-env.
using "moduleResolution": "Bundler"
in tsconfig.json
does fix the red-squiggly lines in vscode.
from t3-env.
Considering this closed then, also added a note in docs about esm only. Reopen if you still have issues
from t3-env.
@juliusmarminge Thank you for sharing great links, that works!
from t3-env.
I just stumbled across this issue too.
Maybe its worth adding a line into the README about this, so people can self-serve easier in future?
from t3-env.
Maybe its worth adding a line into the README about this, so people can self-serve easier in future?
Its in the docs
from t3-env.
so whats the final resolution now? downgrading to 0.91?
from t3-env.
so whats the final resolution now? downgrading to 0.91?
no, swap moduleResolution: node
to moduleResolution: bundler
in your tsconfig (or NodeNext
if transpiling using tsc).
from t3-env.
still face the same issue for expressjs
from t3-env.
Related Issues (20)
- Vercel preset in `@t3-oss/env-nextjs` should include `NEXT_PUBLIC_VERCEL_*` variables HOT 3
- Feature Request: Support for passing zod Schema instead of object HOT 1
- Support both process.env and import.meta.env HOT 1
- Accesing server-side env from client error thrown when importing Zod types generated from Drizzle schema HOT 1
- Empty `extends` array introduces type error TS2339 HOT 1
- Can't use env in drizzle.config.ts file HOT 31
- Multiple .env files in a monorepo HOT 5
- Cannot find module '@t3-oss/env-nextjs' or its corresponding type declarations HOT 3
- feat: ability to specify unique values HOT 2
- Behavior Change when `clientPrefix` is empty HOT 1
- Error: Invalid environment variables HOT 1
- type declaration missing on v0.9.2 HOT 2
- Add note that path aliases will stop working if you use jiti HOT 1
- Can't explicitly pass `clientPrefix` option using `nuxt` HOT 6
- How to augment `proccess.env` as well from `createEnv` output. HOT 2
- Question: How to use with Expo HOT 3
- Updating from 0.8.0 to 0.9.2 seems to have broken import paths HOT 2
- Error while generating production build for the web application HOT 2
- Not able to get next.config.js environment variable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from t3-env.