Repository navigation
Description
What happens
prisma@8.0.0-rc.29 (the current latest) cannot emit the contract of a project on @prisma/orm-postgres@8.0.0-rc.22 (the current latest there). A fresh orm init fails at its own emit step, and every later prisma contract emit fails the same way:
✘ [CLI.INIT_EMIT_FAILED] Failed to emit contract
why: `prisma contract emit` failed: `prisma contract emit` exited with code 2: CLI.UNEXPECTED: Cannot use 'in' operator to search for 'kind' in typeChoice
▸ Resolving contract source...
✘ [CLI.UNEXPECTED] Cannot use 'in' operator to search for 'kind' in typeChoice
The cause is the same shape as #329: rc.29 pins @prisma/orm-toolchain@8.0.0-rc.21, while @prisma/orm-postgres@8.0.0-rc.22 brings @prisma/orm-toolchain@8.0.0-rc.22, so two toolchains end up in the tree and the rc.21 one cannot read the rc.22 family pack:
├─┬ @prisma/orm-postgres@8.0.0-rc.22
│ └── @prisma/orm-toolchain@8.0.0-rc.22
└─┬ prisma@8.0.0-rc.29
└── @prisma/orm-toolchain@8.0.0-rc.21
This is not specific to monorepos. prisma/orm#30935 and prisma/orm#30939 report it from Bun and npm workspaces and conclude that it is a workspace resolution problem, but it reproduces in a single-package npm project with nothing but npm init -y and the documented init command. Anyone starting a new Prisma ORM 8 project since @prisma/orm-postgres@8.0.0-rc.22 was published (2026-10-30) hits it.
Reproduction
mkdir repro && cd repro && npm init -y
npx prisma@latest orm init --yes --target postgres --authoring psl
# scaffold is written, then:
# ✘ [CLI.INIT_EMIT_FAILED] ... Cannot use 'in' operator to search for 'kind' in typeChoice
npx prisma contract emit
# ✘ [CLI.UNEXPECTED] Cannot use 'in' operator to search for 'kind' in typeChoice
npm ls @prisma/orm-toolchain
# rc.21 under prisma, rc.22 under @prisma/orm-postgresExpected
orm init on the published latest tags emits the scaffold contract, and contract emit works on a project whose @prisma/orm-postgres is the current latest.
The fix is merged, not released
#381 (merged 2026-10-31) moves the CLI to @prisma/orm-toolchain@8.0.0-rc.22. No release contains it: latest is rc.29 from 2026-10-30, and dev (8.0.0-rc.29-dev.177) depends on @prisma/orm-toolchain@8.0.0-rc.22-dev.1, which fails against rc.22 with RUNTIME.MULTIPLE_ORM_COPIES instead.
#380 (8.0.0-rc.30) is open with green checks. Could it be released with #381 included?
Workarounds I tested on the reproduction above
- Pin the ORM down to the CLI's toolchain:
npm i @prisma/orm-postgres@8.0.0-rc.21.contract emitthen works. This is what I used to validate the Qwik integration below. - Override the CLI's toolchain up, as Prisma 8 contract emit fails inside Bun/Turborepo monorepos with Cannot use 'in' operator to search for 'kind' in typeChoice orm#30935 does:
"overrides": { "@prisma/orm-toolchain": "8.0.0-rc.22" }. The typeChoice error goes away, but the scaffold that rc.29'sorm initwrites then fails withPSL_UNRESOLVED_REFERENCE: Cannot find type "temporal.UpdatedAtString", because rc.22 dropped the capitalizedtemporal.UpdatedAtStringandtemporal.UpdatedAtJsDatealiases that rc.21 still had. The scaffold template needstemporal.updatedAtString(or whatever rc.22 intends) when the CLI moves to rc.22. prisma@devdoes not help today, see above.
Why this matters
A fresh ORM 8 setup should work with the published latest of prisma and @prisma/orm-postgres together. Today a new user has to discover the toolchain mismatch from a CLI.UNEXPECTED error that points nowhere, then find a matching release candidate to pin. Beyond the release, the suggestion from #329 still stands: when the project's @prisma/orm-* version differs from the toolchain the CLI bundles, say so in the error.
Where I hit it
- docs(prisma): update the Prisma guide to Prisma ORM 8 and fix dead links QwikDev/qwik#9357 (Qwik's Prisma integration guide, moved to ORM 8) is held in draft on this.
- feat(starters): move the qwik add prisma starter to Prisma ORM 8 with PostgreSQL QwikDev/qwik#9358 (the
qwik add prismastarter, moved to ORM 8) is held in draft on this. Its post-install step isprisma contract emit, which fails on a fresh app today.
Environment
prisma8.0.0-rc.29,@prisma/orm-postgres8.0.0-rc.22,@prisma/cli-engine0.9.0- Node 24.11.1, npm 11.6.2, macOS 15.6 (Darwin 24.6.0)
Activity
ankur-arch commentedon Nov 3, 2026
Confirmed fixed by
prisma@8.0.0-rc.30(published 2026-11-03, includes #381):prisma contract emitandprisma db initalso work on a project that already had@prisma/orm-postgres@8.0.0-rc.22installed. Thetemporal.UpdatedAtStringscaffold note no longer applies: rc.30'sorm initscaffold emits cleanly. Closing.