Prisma breaks when on production server (dedicated server, backend app)
This compiles and runs just fine on my local machine, no errors whatsoever.
So I push my schema, merge my deploy request on planet scale, pull the code, and start the app then I get this error:
18 Replies
Did you generate your database package? Looks like that might be causing this
Personally I run yarn db:generate as a post install script
I generated it multiple times
generated it on the server side that you're running on right? what are you hosting this discord bot on?
A shitty ubuntu server from oracle
so I have my dist in git
I build on my machine, push the built code and run that
That's worked up to this point but now Im having that issue
The VM isn't strong enough to handle building the whole project lmfao
im pretty sure you'd be able to host it for free on railway, that'd be at least a bit better
aside from that, im 90% sure your error is being caused from not generating your prisma typings, try doing it on the server and see if it fixes it
whenever ive encountered that before its been from not generating prisma
I just finally got a server with 20gb ram and 3cpu cores and its on intel instead of 1cpu with 1gb ram on AMD lmao
so now I can build on the server and not just on my client
i do not understand the status of this question
THat's what I'm getting when building on my serevr
builds without any errors on my local machine
what node version is your server & local machine running
you may want to get those in sync although it might not make a difference, especially for pnpm since that is where the error looks like its being caused from
is your code open source?
also is your local machine windows and server linux? looking at the error "tsconfig/library.json" maybe it has to do with relative paths i.e doing ./tsconfig/library.json instead
also check typescript versions
Local machine is windows
server is linux
I need to switch back to linux as a desktop I regret coming back to windows
My mentor misled me dearly
I've never had issues with this in the liek 2 months I've been working on this
Ended up restarting my machine and now it seems to be throwing another error
this is pissing me off
Did you update pnpm, ts, etc?
I got it working
What fixed it?
Missing dependency for a local package
Which is weird because it would work fine on my local system without the tsconfig package installed, but break in prod
But either way it’s deployed now
Ah I bet that was a fun one to debug
Yeah. Was a last ditch effort of manually searching through every field of every config file to find the error
Not for all packages but for the ones that were throwing errors, turned out my internal storage package also was causing issues