Giter Site home page Giter Site logo

Comments (20)

Re4GD avatar Re4GD commented on June 8, 2024 7

Try:

import { createEnv } from "@t3-oss/env-nextjs/dist";
import { createEnv } from "@t3-oss/env-core/dist";

from t3-env.

juliusmarminge avatar juliusmarminge commented on June 8, 2024 5

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:

from t3-env.

akodkod avatar akodkod commented on June 8, 2024 2

Downgrading to v0.9.1 fixes the issue.

from t3-env.

ryota-murakami avatar ryota-murakami commented on June 8, 2024 1

This is reproduction repo.
https://github.com/ryota-murakami/guestbook

from t3-env.

valerius21 avatar valerius21 commented on June 8, 2024 1

Thank you all! I will provide a reproducible next time :)

from t3-env.

deadcoder0904 avatar deadcoder0904 commented on June 8, 2024

related issue: #168

from t3-env.

juliusmarminge avatar juliusmarminge commented on June 8, 2024

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.

deadcoder0904 avatar deadcoder0904 commented on June 8, 2024

using "moduleResolution": "Bundler" in tsconfig.json does fix the red-squiggly lines in vscode.

from t3-env.

juliusmarminge avatar juliusmarminge commented on June 8, 2024

Considering this closed then, also added a note in docs about esm only. Reopen if you still have issues

from t3-env.

ryota-murakami avatar ryota-murakami commented on June 8, 2024

@juliusmarminge Thank you for sharing great links, that works!

from t3-env.

RussOakham avatar RussOakham commented on June 8, 2024

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.

juliusmarminge avatar juliusmarminge commented on June 8, 2024

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.

ChiefORZ avatar ChiefORZ commented on June 8, 2024

so whats the final resolution now? downgrading to 0.91?

from t3-env.

juliusmarminge avatar juliusmarminge commented on June 8, 2024

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.

isggwp avatar isggwp commented on June 8, 2024

still face the same issue for expressjs

from t3-env.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.