Skip to content

prisma 8.0.0-rc.29 cannot emit with @prisma/orm-postgres 8.0.0-rc.22 (bundles orm-toolchain rc.21): fresh orm init fails, please release #381 #382

Closed

Description

@ankur-arch

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-postgres

Expected

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 emit then 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's orm init writes then fails with PSL_UNRESOLVED_REFERENCE: Cannot find type "temporal.UpdatedAtString", because rc.22 dropped the capitalized temporal.UpdatedAtString and temporal.UpdatedAtJsDate aliases that rc.21 still had. The scaffold template needs temporal.updatedAtString (or whatever rc.22 intends) when the CLI moves to rc.22.
  • prisma@dev does 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

Environment

  • prisma 8.0.0-rc.29, @prisma/orm-postgres 8.0.0-rc.22, @prisma/cli-engine 0.9.0
  • Node 24.11.1, npm 11.6.2, macOS 15.6 (Darwin 24.6.0)

Activity

  1. ankur-arch commented on Nov 3, 2026

    @ankur-arch
    ContributorAuthor

    Confirmed fixed by prisma@8.0.0-rc.30 (published 2026-11-03, includes #381):

    mkdir repro && cd repro && npm init -y
    npx prisma@latest orm init --yes --target postgres --authoring psl
    # writes src/prisma/contract.json and contract.d.ts, no CLI.INIT_EMIT_FAILED
    npm ls @prisma/orm-toolchain
    # @prisma/orm-toolchain@8.0.0-rc.22 deduped under both prisma@8.0.0-rc.30 and @prisma/orm-postgres@8.0.0-rc.22

    prisma contract emit and prisma db init also work on a project that already had @prisma/orm-postgres@8.0.0-rc.22 installed. The temporal.UpdatedAtString scaffold note no longer applies: rc.30's orm init scaffold emits cleanly. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions