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)

Most upvoted comments

: Error { status: InvalidArg, reason: “missing field enableTracing”, maybe_raw: 0x0 } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread ‘<unnamed>’ panicked at query-engine/query-engine-node-api/src/engine.rs:76:45: Failed to deserialize constructor options. This usually happens when the javascript object passed to the constructor is missing properties for the ConstructorOptions fields that must have some value. If you set some of these in javascript through environment variables, make sure there are values for data_model, log_level, and any field that is not Option<T>

When deploying to production. This fix only works locally in dev for me unfortunately.

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.

It seems that in Prisma 6.6.0, the way to specify the prisma.schema path has changed. I was able to get it working by following the suggestion in this comment

In my case, since I have the schemas in prisma/schema/*.prisma, I added this to my package.json:

"prisma": {
  "schema": "prisma/schema"
}

This worked

It seems that in Prisma 6.6.0, the way to specify the prisma.schema path has changed. I was able to get it working by following the suggestion in this comment

In my case, since I have the schemas in prisma/schema/*.prisma:

  1. I added this to my package.json:
"prisma": {
  "schema": "prisma/schema"
}
  1. I had to move the migrations folder inside prisma/schema folder 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.

            : Error { status: InvalidArg, reason: "missing field `enableTracing`", maybe_raw: 0x0 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at query-engine/query-engine-node-api/src/engine.rs:76:45:
            Failed to deserialize constructor options.
            This usually happens when the javascript object passed to the constructor is missing
            properties for the ConstructorOptions fields that must have some value.
            If you set some of these in javascript through environment variables, make sure there are
            values for data_model, log_level, and any field that is not Option<T>

When deploying to production. This fix only works locally in dev for me unfortunately.

: Error { status: InvalidArg, reason: “missing field enableTracing”, maybe_raw: 0x0 } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread ‘’ panicked at query-engine/query-engine-node-api/src/engine.rs:76:45: Failed to deserialize constructor options. This usually happens when the javascript object passed to the constructor is missing properties for the ConstructorOptions fields that must have some value. If you set some of these in javascript through environment variables, make sure there are values for data_model, log_level, and any field that is not Option When deploying to production. This fix only works locally in dev for me unfortunately.

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.

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 prisma and @prisma/client versions 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 generate step is running correctly for your production builds? 🤔

Edit: Maybe especially check if you are using pnpx prisma or npx prisma on 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/client code. 😉

We were running into the same issue, after upgrading from 6.0.1 to 6.3.1 its working now

Downgrading to ~6.5.0 worked for us

try downgrade to version 6.3.0

Same issue

user@example % npx prisma@6.5.0 generate          
Environment variables loaded from .env
Prisma schema loaded from prisma/schema

✔ Generated Prisma Client (v5.22.0) to ./node_modules/@prisma/client in 470ms

Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)

Tip: Want real-time updates to your database without manual polling? Discover how with Pulse: https://pris.ly/tip-0-pulse


warn Versions of prisma@6.5.0 and @prisma/client@5.22.0 don't match.
This might lead to unexpected behavior.
Please make sure they have the same version.
┌─────────────────────────────────────────────────────────┐
│  Update available 6.5.0 -> 6.6.0                        │
│  Run the following to update                            │
│    npm i --save-dev prisma@latest                       │
│    npm i @prisma/client@latest                          │
└─────────────────────────────────────────────────────────┘
user@example demo % npx prisma@6.6.0 generate
Need to install the following packages:
prisma@6.6.0
Ok to proceed? (y) y

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

Looks like the schema parameter in the PrismaConfig type changed from an object with kind, filePath, etc, to a string.

Edit: Maybe especially check if you are using pnpx prisma or npx prisma on 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/client code. 😉

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

: Error { status: InvalidArg, reason: “missing field enableTracing”, maybe_raw: 0x0 } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread ‘<unnamed>’ panicked at query-engine/query-engine-node-api/src/engine.rs:76:45: Failed to deserialize constructor options. This usually happens when the javascript object passed to the constructor is missing properties for the ConstructorOptions fields that must have some value. If you set some of these in javascript through environment variables, make sure there are values for data_model, log_level, and any field that is not Option<T>

When deploying to production. This fix only works locally in dev for me unfortunately.

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 (enableTracing was introduced in 6.1.0).

Moreover, the logs you posted:

✔ Generated Prisma Client (v5.22.0) to ./node_modules/@prisma/client in 470ms

Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)

Tip: Want real-time updates to your database without manual polling? Discover how with Pulse: https://pris.ly/tip-0-pulse


warn Versions of prisma@6.5.0 and @prisma/client@5.22.0 don't match.
This might lead to unexpected behavior.
Please make sure they have the same version.

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.