how to keep it generated in @prisma/client
how to keep it generated in @prisma/client
1 Reply
You've gone full bot mode! Let me fetch that AI answer for you ASAP.
To keep using
- Run
@prisma/client as the import, you have two different situations depending on which generator you use.
---
1. Using the legacy prisma-client-js (Prisma ≤6, no custom output)
If your generator is still:
then prisma generate writes the project‑specific client into node_modules/.prisma/client, and @prisma/client/index.d.ts re‑exports from there. You just:
and ensure you:
- Have @prisma/client installed- Run
npx prisma generate after schema changes (often via "postinstall": "prisma generate"). [@prisma/client package; CLI generate examples]
Note: this default behavior is deprecated and removed in Prisma 7. [Generating Prisma Client]
---
2. Using the new prisma-client generator (Prisma 7+ recommended)
With the new generator you must use a custom output and import from that path, not @prisma/client:
Here, @prisma/client is no longer the source of your generated client; the code lives in your app tree instead. [Generators overview; Getting started]
You generally should:
- Ignore the generated directory in version control (because of engine binaries). [Getting started]
- Regenera
te on schema changes with npx prisma generate. [What is Prisma]
---
If you’re on Prisma 7 or planning to upgrade, the knowledge sources suggest migrating away from @prisma/client imports toward a custom output + direct path import.