Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this works? #186

Merged
merged 2 commits into from
Feb 8, 2024
Merged

this works? #186

merged 2 commits into from
Feb 8, 2024

Conversation

juliusmarminge
Copy link
Member

No description provided.

Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
t3-env ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 10:02am
t3-env-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 10:02am

"author": "Julius Marminge",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/t3-oss/t3-env",
"directory": "packages/nextjs"
},
"main": "dist/index.js",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this line is breaking the import. Typescript just can't find it anymore. It works on 0.9.1

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance this was an wrong change, @juliusmarminge ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only breaking if your tsconfig cant read exports field

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same to me:

My tsconfig:

{
  "compilerOptions": {
    "tsBuildInfoFile": "node_modules/.cache/typescript/tsbuildinfo.json",
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "target": "ES2022",
    "esModuleInterop": true,
    "module": "ESNext",
    "moduleResolution": "Node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "lib": ["ESNext", "DOM", "DOM.Iterable"],
    "noUncheckedIndexedAccess": true,
      "incremental": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    },
    "plugins": [
      {
        "name": "next"
      }
    ],
  },
  "include": [
    "next-env.d.ts",
    "next-auth.d.ts",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts"
  ],
  "exclude": ["node_modules"]
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing typings being locatable or available in 0.10.1 when installed. Additionally, npmjs.org doesn't report them as being available, either. See the screenshot of released versions:

npmjs-typescript

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll get types through exports condition if you have a modern moduleResolution

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliusmarminge : Ahh ... you're correct. Using something like moduleResolution: "bundler" correctly identifies the types. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants