deploy prisma/client not found
hey, when I deploy the prisma client in node_modules is not found because its not generating, I have added a postinstall startup script with prisma generate command but this is not triggering after the install for some reason, does someone know why? I am also using bun 1.0
48 Replies
Project ID:
3bb8b6a8-40e5-4cef-b8d2-3c491bb9e5e3
3bb8b6a8-40e5-4cef-b8d2-3c491bb9e5e3
i tried it out locally and it worked after bun install it triggered the postinstall and ran prisma generate
have you tried adding
npx prisma generate
in the build command? (even though prisma should auto generate it after installing it)
(sorry bunx not npx if you're using bun)yes but it doesnt seem to trigger
Can you share your package json and error logs?
here is my package.json
build logs ^ is running prisma generate but somehow just skipping it then
sorry for the late reply
I tired everything and i get the same error, I think it's a bun error
hmm ok
but it works locally
for me running locally
bun x prisma generate
doesen't do anythingbunx prisma generate works locally for me
are you on linux/max or WSL?
mac
oh, then bunx doesen't work for me because of wsl
guess we'll wait for brody to check this
okay
From bun discord server it seems like to run prisma and bun you also need nodejs, which I don't think railway is using with bun (i'm not sure) @vergeilt
Michael, do you have a nixpacks.toml
try to run the prisma generate at runtime
"start": "prisma generate && bun --bun run ./build/index.js"
i do have a nixpacks.toml
I have tried that too, it seems like prisma just doesen't do anything with prisma generate
send it please
try that, then run the prisma generate thingy with node instead
Worked for me
yay
Brody the best
thank you!
Brody i will donate to you
thanks for your work
you really don't have to, but thank you
running into the same problem, added nixPkgs line in nixpacks.toml and getting this:
try adding
libssl-dev
to aptPkgs
still same error
i tried this with the setup brody said and its still not really working its not running prisma generate for some reason
im running npx prisma generate in my start script now or how would you do it
I'd run it in a prisma build phase
https://nixpacks.com/docs/configuration/file#phases
nhm ok so for some reason it is not working still though
its like doing nothing
im also not sure why its running bun x prisma generate when my build script looks like this
do you have a build script set somewhere else? like in the service settings, a nixpacks.toml, a railway.json, etc
nope
is it maybe becuase i use bun --bun run build ?
but without the --bun its also running bun x prisma generate
railway won't change your build command, you likely have it set somewhere else
but when i locally run bun run build it works
i dont have a railway.json only this
in my nixpacks.toml
my recommendation would be to stick with node unless you know that bun will give you a measurable performance gain
what is your start command anyway
yeah i mean its not just the performance i love bun with all the stuff integrated already i use some functions of it such as the password hashing
i think i got it working on railway now
im now doing the prisma generate before the build
which makes sense tbh but locally it didnt matter somehow
^
bun run start
and then
oh im having the same error now as the other guy
this doesnt seem to change anything
still the same error
I'm out of ideas besides build with a dockerfile
Try removing your nixpacks.toml
With your
nixpkgsArchive
you're sticking it to a old archive version (pre-Bun support), it's no longer needed since that was upstreamed and contains latest Bun
With how you're defining providers, looks like you'd have both bun and node together
There's possibly some conflict between node/bun on libssl