PrismaP
Prisma4mo ago
4 replies
Amine,

upgrading from v5 to v6

Hi, hope whoever reads this is doing good.

I got this Prisma error after upgrading from v5 to v6.
The reason I upgraded is because I wanted to split my big schema into multiple
.prisma
files inside a /models folder.

That part works fine — but the problem is that the new Prisma version doesn’t generate the client in
node_modules
anymore.
So I added this in my generator:

output = "../generated/client"


Now the client gets generated, but it looks like Prisma combines all my schema files into one big schema, and then it throws this error:

The generator "client" cannot be defined because a generator with that name already exists.


After that, when I try to use the generated client in my Node app, I get this error:

Error: Cannot find module '../../generated/client'
Require stack:
- /dist/src/prisma/prisma.service.js
- /dist/src/app.controller.js
- /dist/src/app.module.js
- /dist/src/main.js


Not sure why, but it also affects my migrations.
When I run a migration, it acts like it’s creating everything from scratch, even though the tables already exist.
Not sure if that’s normal in v6 or if I messed something up.

Here’s my simple Prisma config file (can’t share full code for confidentiality):

import path from 'node:path'
import type { PrismaConfig } from 'prisma'

export default {
  schema: path.join('prisma'),
  migrations: {
    path: path.join('prisma', 'migrations'),
  },
} satisfies PrismaConfig


So yeah, that’s what’s happening.
I just want to know:

* is this normal for Prisma v6 when using multi-file schemas?
* or is there something I should change so it only generates one client and doesn’t reset migrations?

Thanks in advance 🙏
Screenshot_2025-10-09_132651.png
Screenshot_2025-10-09_132713.png
Was this page helpful?