chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
579 stars 43 forks source link

Support .js file extensions for TypeScript ESM on Node #150

Open khalil-omer opened 1 year ago

khalil-omer commented 1 year ago
Relative import paths need explicit file extensions in EcmaScript imports when 
'--moduleResolution' is 'node16' or 'nodenext'. 
Did you mean '../inputTypeSchemas/NullableJsonValue.js'?ts(2835)

When useMultipleFiles is true, the imports between generated files throw errors if using modern module resolution in the tsconfig.

lugrinder commented 10 months ago

I adhere to this request, please add file extension on this situation.

PS1TD commented 5 months ago

Really need this. Without .js extention on prisma client path and also on between file imports if multiple files is turned on cannot use this generator in esm projects

PS1TD commented 5 months ago

Found a workaround for now. Transpile using Babel with "babel-plugin-add-import-extension" plugin. Also set module: "Bundler" in tsconfig