prisma: Prisma 6.6.0 does not work with `prismaSchemaFolder`
Bug description
Prisma does not recognize schema folder in v6.6.0
# migrations folder hidden for brevity
❯ tree prisma
prisma
├── schema
│ ├── config.prisma
│ ├── devops.prisma
│ ├── index.prisma
│ └── subscriptions.prisma
└── seed.ts
1 directory, 5 files
❯ pnpm prisma generate
Environment variables loaded from .env
Error: Could not find Prisma Schema that is required for this command.
You can either provide it with `--schema` argument,
set it in your `prisma.config.ts`,
set it as `prisma.schema` in your package.json,
or put it into the default location (`./prisma/schema.prisma`, or `./schema.prisma`.
Checked following paths:
schema.prisma: file not found
prisma/schema.prisma: file not found
See also https://pris.ly/d/prisma-schema-location
Severity
⚠️ Major: Breaks core functionality (e.g., migrations fail)
Reproduction
will add later.
Expected vs. Actual Behavior
To work just as ~6.5.0
Frequency
Consistently reproducible
Does this occur in development or production?
Only in development (e.g., CLI tools, migrations, Prisma Studio)
Is this a regression?
Yes, it worked before.
Workaround
Dowgrading prisma
Prisma Schema & Queries
no need.
Logs & Debug Info
No response
Environment & Setup
{
npm: '10.8.2',
node: '20.15.1',
acorn: '8.11.3',
ada: '2.7.8',
ares: '1.28.1',
base64: '0.5.2',
brotli: '1.1.0',
cjs_module_lexer: '1.2.2',
cldr: '45.0',
icu: '75.1',
llhttp: '8.1.2',
modules: '115',
napi: '9',
nghttp2: '1.61.0',
nghttp3: '0.7.0',
ngtcp2: '1.1.0',
openssl: '3.0.13+quic',
simdutf: '5.2.8',
tz: '2024a',
undici: '6.13.0',
unicode: '15.1',
uv: '1.46.0',
uvwasi: '0.0.21',
v8: '11.3.244.8-node.23',
zlib: '1.3.0.1-motley-7d77fb7'
}
Prisma Version
prisma : 6.6.0
@prisma/client : 6.6.0
Computed binaryTarget : debian-openssl-3.0.x
Operating System : linux
Architecture : x64
Node.js : v20.15.1
TypeScript : 5.5.4
Query Engine (Node-API) : libquery-engine f676762280b54cd07c770017ed3711ddde35f37a (at node_modules/.pnpm/@prisma+engines@6.6.0/node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine : schema-engine-cli f676762280b54cd07c770017ed3711ddde35f37a (at node_modules/.pnpm/@prisma+engines@6.6.0/node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm : @prisma/prisma-schema-wasm 6.6.0-53.f676762280b54cd07c770017ed3711ddde35f37a
Default Engines Hash : f676762280b54cd07c770017ed3711ddde35f37a
Studio : 0.511.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 24
- Comments: 21 (4 by maintainers)
We have the same error on our production with Prisma version 5.22.0. I don’t know how this is possible, but it is and the fix doesn’t work. It appeared randomly after we rebuilt our docker. We tried reversing the commits to see if it was related, but the error is still there.
This worked
It seems that in Prisma 6.6.0, the way to specify the
prisma.schemapath has changed. I was able to get it working by following the suggestion in this commentIn my case, since I have the schemas in
prisma/schema/*.prisma:package.json:prisma/schemafolder as well, otherwise the migrations wouldn’t run.We are also having the same issue on our production build. We are on also on version 5.22.0.
When deploying to production. This fix only works locally in dev for me unfortunately.
We are running into the same issue. Also on 5.22.
Same issue here!
Hi all 👋
Yes we did a breaking change to the Prisma schema folder behavior and if you want to use a schema folder you now need to always specify it explicitly. We did this change as the implicit behavior caused various confusions and this feature was (and is) still in preview.
More details as already mentioned by others in this comment.
This is a change introduced in Prisma 6.6.0 so this should not affect older Prisma versions. If you are experiencing issues with older prisma versions can you please check that your
prismaand@prisma/clientversions are identical? @canbalkaya @keenankaufman @remotasiteadmin ?@remotasiteadmin: The error you are getting sounds like your deployment is having some form of version mismatch between the JavaScript and Rust parts. Can you double check your versions and that the
prisma generatestep is running correctly for your production builds? 🤔Edit: Maybe especially check if you are using
pnpx prismaornpx prismaon CI. Those commands might fall back to using the latest version of a package on npm if they cannot find a locally installed or cached version. Then they would potentially generate a client that is not compatible with the installed@prisma/clientcode. 😉We were running into the same issue, after upgrading from
6.0.1to6.3.1its working nowDowngrading to ~6.5.0 worked for us
try downgrade to version 6.3.0
Same issue
Looks like the
schemaparameter in thePrismaConfigtype changed from an object withkind,filePath, etc, to a string.This was the key for me. When deploying to Google Cloud Functions, this was running:
"postinstall": "cross-env CI=1 npx prisma generate",I changed it to add the specific version of prisma we currently use and things started working again:
"postinstall": "cross-env CI=1 npx prisma@5.22.0 generate",This function and deployment had been working for years so it was a bit of a surprise, but good to know this will keep it stable.
@remotasiteadmin
This error means you have a new query engine version (installed by a recent Prisma CLI version), and a very old and incompatible version of the Prisma Client (
enableTracingwas introduced in 6.1.0).Moreover, the logs you posted:
clearly show your Prisma Client version is 5.22.0 and have a warning about the mismatch.
Please don’t mix incompatible versions of different packages, especially multiple major versions. All your Prisma ORM packages must have the exact same version.
Previously, we used Prisma 5.2.2 (prisma and @prisma/client). After upgrading to 6.3.1, everything is working.
Same issue from 5.22. I tried to downgrade but it did not fix.