Prisma Client not initialising when Nextjs project is being deployed to Caprover

376 Views Asked by At

When trying to deploy my Nextjs v12 projects to my Caprover server I am now seeing an unexpected error related to prisma:

Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.

Does anybody know how I can go about trying to identify what may be causing this issue?

P.S. The project builds fine when being built locally with npm run build & the project has previously been deployed without issue. I have also tried running npx prisma generate and deploying again.

P.P.S When adding RUN npx prisma generate to my Dockerfile, a new error is returned:

Error: Get config: Unable to establish a connection to query-engine-node-api library
1

There are 1 best solutions below

0
On

This was solved by changing the Node version in my Dockerfile as suggested in this thread https://github.com/prisma/prisma/issues/14073. Really weird for this issue to seemingly come out of nowhere but it's working ‍♂️