You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 exports JavaScript as both CJS and ESM.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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 exports JavaScript as both CJS and ESM.Zod was imported via:
import * as z from 'zod';
Original error report to Zod:
colinhacks/zod#168 (comment)
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
Vite: ^2.1.0
@sveltejs/kit: next
zod: ^3.0.0-alpha.24
Node: v14.7.0
MacOS
Beta Was this translation helpful? Give feedback.
All reactions