Prisma 7.10 is safe to commit the generated/prisma client? #30168
Replies: 7 comments
|
The recommendation still stands: you should NOT commit the Why you should keep it in
|
|
The Rust-free architecture changes what can be generated, but it does not by itself change the source-control recommendation. Prisma's current generator reference still explicitly says to exclude the generated directory from version control. The main reason is that the generated output may include a platform-specific query engine unless you use
For a normal application on Prisma 7.10, I would therefore keep this committed:
and keep If you explicitly use |
|
I think the key distinction is that Rust-free does not automatically mean that the generated client should be committed. With Prisma 7, if you're using the default setup, I'd still keep However, if you're explicitly using: generator client {
provider = "prisma-client"
output = "../generated/prisma"
engineType = "client"
}then the generated client no longer depends on the Rust query engine binary. In that case, committing the generated output can be technically viable, especially if your deployment environment makes running So I'd separate the two questions:
The Rust-free architecture mainly removes the platform-specific Rust engine concern; it doesn't remove the maintenance problem of keeping generated code synchronized with the schema and installed Prisma version. |
|
It's safe in the sense that Prisma 7 generates plain TypeScript, but the current Prisma docs still recommend keeping the generated client out of git. "prisma init" also adds "/generated/prisma" to ".gitignore". So I'd still treat it as a build artifact and run "prisma generate" during install/build rather than commit it. |
|
I recently dealt with this while deploying a Prisma 7 project in Docker, and I would still avoid committing generated/prisma by default. What worked well for me was generating the client as part of the Docker/build process: COPY package.json bun.lock ./ COPY prisma ./prisma COPY . . I keep the schema, migrations, prisma.config.ts and lockfile in Git, while the generated client stays ignored. The important distinction IMO is that removing the Rust engine dependency makes the generated output more portable, but it doesn't really turn generated code into source code that needs to be versioned. Generating it during the build also guarantees that the client matches the Prisma version and schema used by that deployment. I would only consider committing it if the deployment environment specifically cannot run prisma generate. Otherwise, generating it in CI/Docker keeps the repository cleaner and avoids the generated client getting out of sync. |
|
Yes, it’s technically safe to commit the generated Prisma Client in Prisma 7.10, but I still wouldn’t recommend it for a normal app. Rust-free mainly removes the platform-specific binary concern; it doesn’t remove the risk of generated code getting out of sync with your schema or Prisma version. Better approach:
So: safe to commit, but better treated as generated build output. |
|
Short answer: yes, committing the generated client is now the recommended default in Prisma 6+ / V8. Here is why the guidance changed:
Practical checklist for Prisma 7.10
generator client {
provider = "prisma-client-js"
output = "./generated/prisma"
}
If you are still on the default |
Uh oh!
There was an error while loading. Please reload this page.
In the last versions of Prisma it was recommended to not commit the generated code of Prisma Client, but in the new version of Prisma Next V8 and Prisma 7.10 it is safe?
I understand that there is a Discussions where it was recommended to not commit the generated/prisma.
But now in 2026 it is Rust free so why is it not recommended?
All reactions