nixpacks: Unable to get prisma 5 with nixpacks openssl
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Following up on the issue Prisma does support open ssl 3.0.x now.
However, for some reason I’m still not able to use nixpack with Prisma.
I tried installing libssl-dev
in setup stage and got the same error.
To reproduce
After building i get the following error on trying to instantiate PrismaClient()
:
index.ts
import { PrismaClient} from '@prisma/client'
const prisma = new PrismaClient();
Error:
PrismaClientInitializationError: Unable to require(`/app/node_modules/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node`).
Prisma cannot find the required `libssl` system library in your system. Please install openssl-3.0.x and try again.
Details: libssl.so.3: cannot open shared object file: No such file or directory
at new e (/app/node_modules/@prisma/client/runtime/library.js:26:1871)
Noticed that it’s using libquery_engine-debian-openssl-3.0.x.so.node - shouldn’t be using ubuntu version not debian ?
Expected behavior
Able to build and deploy application using Prisma.
Environment
nixpacks.toml
[phases.setup]
aptPkgs = ["..."]
[phases.build]
cmds = ["...", "bunx prisma generate", "bunx prisma migrate deploy"]
package.json
"dependencies": {
"@prisma/client": "5.7.0",
},
Bun: 1.0.17
I have no problems running locally.
About this issue
- Original URL
- State: open
- Created 7 months ago
- Reactions: 1
- Comments: 19 (6 by maintainers)
Bumping this as I’m getting the exact issue to @Maxim-Filimonov. Everything works locally, but deploying to railway is a journey of painful debugging.
@coffee-cup if you need some hard evidence, I would suggest running through these steps:
"prisma": "5.7.1"
and"@prisma/client": "5.7.1"
(versions shouldn’t matter, but some devs reported having it fixed downgrading or upgrading… error was replicated with v5.3.x and v5.7.x on my side).schema.prisma
:What’s your Prisma schema set-up Maxim ? This is mine:
nixpacks.toml
:Error:
Tried to add
'openssl_3_0_x
to mynixPkgs = ['bun', 'openssl_3_0_x']
but that didn’t work.Also, changing start cmd from
bun run src/index.ts
tobun run build/indexjs
will produce error:@iloveitaly Nah, I that’s not it… I think nixpacks even detected that it needs openssl by default for my project.
Still, I tried to specifically tell it to add the openssl lib with the env
NIXPACKS_PKGS=openssl
The problem happens at runtime, on the docker when the app is running, on Prisma init, it says:
@iloveitaly where to add
--libs openssl
?My fix was to migrate to fly.io 😐
+1 couldn’t get it to work either