-
Notifications
You must be signed in to change notification settings - Fork 335
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
fix: Add types to exports field in package.json to resolve type errors #368
Conversation
Bah I thought this was working fine :( Thanks for sending a fix! Not at a computer to test something but I'm curious if this would have been fine if the .d.mts was moved into lib/esm... |
@zpao When I renamed lib/esm/index.d.mts to lib/esm/index.d.ts, the type error no longer occurred. |
Ok back to a computer. Thanks for testing! I was wondering if there was some default behavior we could piggyback on. That said, I'm struggling to reproduce the issue with the published package :( I think what you have is technically better so we should still do it but would like to pinpoint the precise conditions that cause the problem. I created a theoretical minimal test case - https://gist.github.com/zpao/af370e6d6a08a07740b8c80b0b76ada2. I used pnpm since you were, but couldn't repro with npm either. I tried node 18, 20, 22, but no luck. Is there perhaps a specific version of node or typescript that does make it happen? |
@zpao {
"compilerOptions": {
...,
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true
}
} And I tested it by creating a project with next.js. pnpm create next-app@latest |
Ah, I should have just set up Next.js and tried that. Looks like Ok, I think it might be safe to remove the Thanks for sticking with me here! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I should really stop using make but it's muscle memory now
closes: #367