diff --git a/apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx b/apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx index a139a5a416..405b53dc04 100644 --- a/apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx +++ b/apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx @@ -154,6 +154,22 @@ Below are the options for the `prisma-client` generator: ::: +:::tip + +**Using `tsx` as your TypeScript runner?** If you see `Cannot find module './internal/class.js'` errors at runtime, set `importFileExtension = "ts"` in your generator block: + +```prisma +generator client { + provider = "prisma-client" + output = "../src/generated/prisma" + importFileExtension = "ts" +} +``` + +This happens because the generated client uses `.js` extensions in its import statements (ESM convention), but `tsx` cannot resolve `.js` imports to the corresponding `.ts` files on disk. Setting `importFileExtension = "ts"` ensures the generated imports match what `tsx` expects. + +::: + ### Importing types The new `prisma-client` generator creates individual `.ts` files which allow for a more fine granular import of types. This can improve compile and typecheck performance and be useful for tree-shaking, too.