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
Unable to get prisma 5 with nixpacks openssl #1030
Comments
Hello, @Maxim-Filimonov! Thanks for your submission. Our team will respond soon. If you need more immediate help, try our Forum or our Discord. Thanks! |
We have an example that builds and runs no problem using Prisma 5 and bun https://github.com/railwayapp/nixpacks/tree/main/examples/node-bun-prisma. I can check this out further, but there is evidence of both working so I am not sure what is going on with your specific repo. Do you have a sample repo that doesn't work with Bun? |
@coffee-cup I tried using linked example and it fails with different error for some reason.
I did add shared variable DATABASE_URL. Also tried using PRIVATE_DATABASE_URL from pg got this instead:
|
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:
What's your Prisma schema set-up Maxim ? datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
output = "./generated/client"
binaryTargets = ["native", "linux-musl", "debian-openssl-3.0.x"]
}
[phases.setup]
nixPkgs = ['bun']
[phases.install]
cmds = ['bun install']
[phases.build]
cmds = ['bunx prisma generate',
'bunx prisma migrate deploy',
'bun build --target=bun ./src/index.ts --outdir ./build']
[start]
cmd = 'bun run src/index.ts' Error: PrismaClientInitializationError: Unable to require(`/app/prisma/generated/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 Tried to add Also, changing start cmd from Server is running at localhost:5000
1 | __dirname
^
ReferenceError: Can't find variable: __dirname
at /app/build/index.js:1604:69
at processTicksAndRejections (:61:76) |
+1 couldn't get it to work either |
I have the exact same error when trying to deploy an Elysia app. Has anyone found a fix? |
My fix was to migrate to fly.io :| |
|
@iloveitaly where to add |
@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
The problem happens at runtime, on the docker when the app is running, on Prisma init, it says:
|
You need it as a lib, not as a package. Without this the ENV config is not changed. Take a look at the linked PR: #1054 |
Hey ! Thanks ! |
Even on the latest
|
where do you add @Maxim-Filimonov were you able to resolve this? |
@ksaitor I haven't tried since it wasn't working when I needed it for initial launch. It works pretty well on fly I don't really see a reason why try to move it back to railway TBH. |
Fixable by simply specifying binaryTargets |
added cc @baptisteArno check it out |
@ksaitor Could you link the Railway project where it works or a repo with it working so that we can fix it at the nixpacks level? |
@JakeCooper I'm not on Railway. I'm on Coolify, that's using Nixpacks under the hood. Nixpacks v1.21.2. |
Is there an existing issue for this?
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
Error:
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
package.json
Bun: 1.0.17
I have no problems running locally.
The text was updated successfully, but these errors were encountered: