Skip to content

docs(generators): add tip for tsx users about importFileExtension#7714

Open
Andrew1326 wants to merge 1 commit intoprisma:mainfrom
Andrew1326:docs/tsx-importFileExtension-note
Open

docs(generators): add tip for tsx users about importFileExtension#7714
Andrew1326 wants to merge 1 commit intoprisma:mainfrom
Andrew1326:docs/tsx-importFileExtension-note

Conversation

@Andrew1326
Copy link

@Andrew1326 Andrew1326 commented Mar 26, 2026

Summary

  • Adds a tip in the generators reference explaining the importFileExtension = "ts" fix for tsx users
  • Addresses the common Cannot find module './internal/class.js' error when running Prisma 7's generated client with tsx

Context

This is a frequently asked question in Prisma Discussions (#29318, #29347). The generated client uses .js import extensions (ESM convention), but tsx cannot resolve .js to .ts files on disk. The fix is simple (importFileExtension = "ts"), but users struggle to find it since the current docs don't mention tsx specifically.

Summary by CodeRabbit

  • Documentation
    • Added documentation providing guidance on resolving tsx runtime module resolution errors with Prisma. The section includes a practical configuration example and explains how aligning the import file extension setting to ts resolves conflicts between generated client imports and tsx's module resolution expectations.

Users running Prisma 7's generated client with tsx frequently encounter
'Cannot find module ./internal/class.js' errors because tsx cannot resolve
.js imports to .ts files. This adds a tip explaining the fix
(importFileExtension = "ts") directly in the generators reference.

Addresses recurring questions in Discussions #29318, #29347.
@vercel
Copy link

vercel bot commented Mar 26, 2026

@Andrew1326 is attempting to deploy a commit to the Prisma Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d5238ec5-c02d-47f9-9e7f-e51172ae035f

📥 Commits

Reviewing files that changed from the base of the PR and between 6f79795 and e3674a7.

📒 Files selected for processing (1)
  • apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx

Walkthrough

Documentation added to the Prisma schema generators guide explaining how to resolve runtime module resolution errors when using tsx with the Prisma client generator. The solution configures the importFileExtension setting to align generated imports with tsx module resolution expectations.

Changes

Cohort / File(s) Summary
Prisma Client Generator Documentation
apps/docs/content/docs/orm/prisma-schema/overview/generators.mdx
Added troubleshooting tip for tsx compatibility, including a concrete configuration example and explanation of the root cause: mismatch between generated .js imports and tsx's ability to resolve them to .ts files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: adding documentation guidance for tsx users about the importFileExtension configuration option.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant