-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Vite bundles wrong file from Zod #2639
Comments
The same happens with @supabase/supabase-js, which also has a js entrypoint (in case it helps to know) |
Here's a link to the Supabase issue: supabase/supabase-js#89 |
Does this work if you install it as a |
Oh my, that worked! I thought I tried that, but I removed it and re-added it to be sure, and it worked:
(Worth noting that I originally had it in |
Should this issue be closed then? |
When importing Zod into a Svelte Kit project, Vite attempts to import a typescript file, for an unknown reason. The author of Zod confirmed this should not be happening, it should use Zod's JavaScript entry point.
Error
The error is
ENOENT: no such file or directory, open '/Users/me/my-app/node_modules/zod/src/index.ts'
. But Zod actually has a JavaScript entry point.Zod was imported via:
import * as z from 'zod';
Reproduce
To reproduce, create a svelte kit project
Then in index.svelte, add this import
import * as z from 'zod';
, and save. It should cause an error in the dev server console.Info
The text was updated successfully, but these errors were encountered: