Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down