Skip to content

@prisma/orm-postgres runtime loads the whole toolchain through family__control, so production installs carry esbuild, prettier and the CLI engine #30928

Open

Description

@mastasiano

Package and version

@prisma/[email protected], with @prisma/orm-target-postgres, @prisma/orm-family-sql and @prisma/orm-toolchain at the same version, and @prisma/[email protected].

What happened?

A production install of the PostgreSQL runtime includes the ORM toolchain and everything it brings: esbuild, prettier, vscode-languageserver, clipanion, @prisma/cli-engine and @prisma/management-api-sdk.

@prisma/orm-postgres, @prisma/orm-target-postgres and @prisma/orm-family-sql all list @prisma/orm-toolchain in dependencies, and @prisma/orm-toolchain requires @prisma/cli-engine as a peer at an exact version.

In a minimal install, this tooling is 28 MB of the 85 MB in node_modules. The application only runs queries, so none of it does any work there.

It is more than a declared dependency. Without these packages, the runtime entry does not load:

error: Cannot find module '@prisma/orm-toolchain/migration-tools/spaces'

The static import chain from the runtime entry is:

@prisma/orm-postgres/dist/runtime.mjs
@prisma/orm-target-postgres/dist/adapter__runtime.mjs
@prisma/orm-target-postgres/dist/adapter-DJoHcCZV-B6ixkVJl.mjs
@prisma/orm-target-postgres/dist/contract-contributions-DS1YZqxl-B1ZaAkPj.mjs
@prisma/orm-family-sql/dist/family__control.mjs
@prisma/orm-family-sql/dist/control-1JIbMzKB.mjs   (line 30)
@prisma/orm-toolchain/migration-tools/spaces       (assertDescriptorSelfConsistency)

So the runtime adapter loads the control-plane entry of the SQL family, and through it the toolchain.

What did you expect to happen?

@prisma/orm-postgres/runtime should load no control-plane code, and a production install should not need @prisma/orm-toolchain or @prisma/cli-engine.

Minimal reproduction

mkdir toolchain-in-runtime && cd toolchain-in-runtime
cat > package.json <<'JSON'
{ "private": true, "dependencies": { "@prisma/orm-postgres": "8.0.0-rc.22", "temporal-polyfill": "1.0.6", "typescript": "6.0.3" } }
JSON
bun install --production --ignore-scripts
ls node_modules/esbuild node_modules/prettier node_modules/@prisma/cli-engine
du -sm node_modules

# Remove the tooling, then load the runtime entry.
rm -rf node_modules/@prisma/orm-toolchain
bun -e "await import('@prisma/orm-postgres/runtime')"

The last command fails with the error above. node_modules is 85 MB as installed, 24 MB of which is TypeScript, the optional peer. It is 57 MB once the toolchain, @prisma/cli-engine, @prisma/management-api-sdk, esbuild, @esbuild/*, prettier, clipanion and the vscode-languageserver packages are removed.

Environment

  • Bun 1.4.4 on macOS arm64 for the figures above
  • Same dependency tree in our Linux production image
  • PostgreSQL target, postgres() runtime client

Additional context

#30437 describes the same root cause through @prisma/composer-prisma-cloud. Its proposed fix, publishing migration-tools in a package with no engine peer, would need to cover this path too. Moving assertDescriptorSelfConsistency out of the toolchain, or no longer importing family__control from the runtime adapter, would both remove it.

Deleting these packages from a production image is not a workaround, because the runtime entry stops loading.

— othmane.sayadi

Activity

  1. prisma-asks commented on Oct 30, 2026

    @prisma-asks

    Thanks for reporting this. We're looking into it now: whether we can reproduce it and what impact it has.

    You can follow where this stands here: https://asks.prisma.cool/public/asks/01a18e41-8423-75be-b5cd-c6a556a0f47a

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