Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: docker builds wrong prisma client #2055

Open
maxktz opened this issue Feb 6, 2025 · 0 comments
Open

bug: docker builds wrong prisma client #2055

maxktz opened this issue Feb 6, 2025 · 0 comments

Comments

@maxktz
Copy link

maxktz commented Feb 6, 2025

Provide environment information

  System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M1
    Memory: 145.72 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.7.0 - ~/.nvm/versions/node/v23.7.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v23.7.0/bin/npm
    pnpm: 10.2.0 - ~/.nvm/versions/node/v23.7.0/bin/pnpm
    bun: 1.2.0 - ~/.bun/bin/bun

Describe the bug

generates wrong prisma client in docker build

Then you run container and get

> docker run ...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
...
 ✓ Starting...
 ✓ Ready in 2.4s
[Error [PrismaClientInitializationError]: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".

This happened because Prisma Client was generated for "linux-musl-openssl-3.0.x", but the actual deployment required "debian-openssl-3.0.x".
....

Reproduction repo

https://github.com/maxktz/t3-docker-prisma-bug-reproduction

To reproduce

  1. Init new t3 app
  2. Follow steps from t3 (docker deployment guide)

Additional information

Adding this into binaryTargets in schema works, but doesn't look as a really good approach for me

generator client {
    provider      = "prisma-client-js"
    binaryTargets = ["native", "debian-openssl-3.0.x"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant