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

When moduleResolution: NodeNext, Zod's types fail #3944

Open
lishaduck opened this issue Jan 18, 2025 · 1 comment
Open

When moduleResolution: NodeNext, Zod's types fail #3944

lishaduck opened this issue Jan 18, 2025 · 1 comment

Comments

@lishaduck
Copy link

export * from "./lib";

To be valid (Node-flavored) ESM, this import needs a file extension. In modern moduleResolution settings, TS will fail, and give an error about how Module '"zod"' has no exported member 'z'..

And yes, I'm using skipLibCheck: true, but that suppresses errors; thus, the only error I see is my own code, but the issue is really in Zod.

(This is very important for CLIs, but I switched back to Bundler as I'm developing a web app. I'd just wanted to see what broke, so this isn't breaking me.)

@lishaduck
Copy link
Author

lishaduck commented Jan 18, 2025

I just looked closer and found that there are only extensionless imports in the codebase, so it's nontrivial to just pnpm patch it away.

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

No branches or pull requests

1 participant