angelplusultra
angelplusultra
Explore posts from servers
PPrisma
Created by angelplusultra on 6/11/2024 in #help-and-questions
PrismaClientInitializationError
Hi everyone, I am running a Prisma app with Docker and getting this error when the container runs:
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "linux-musl-openssl-3.0.x".
This happened because Prisma Client was generated for "darwin", but the actual deployment required "linux-musl-openssl-3.0.x".
Add "linux-musl-openssl-3.0.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "linux-musl-openssl-3.0.x".
This happened because Prisma Client was generated for "darwin", but the actual deployment required "linux-musl-openssl-3.0.x".
Add "linux-musl-openssl-3.0.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
I found this (https://github.com/prisma/prisma/issues/8478) Issue on GitHub which goes into this problem however I've attempted all of the suggestions in the entire thread and I'm still getting the error. Here is my current configuration: docker-compose.yaml
auth:
platform: linux/amd64
container_name: auth_api
build:
context: ./backend
dockerfile: auth/Dockerfile
env_file: .env
ports:
- "4000:3000"
volumes:
- "./backend/auth:/usr/src/app/"
- "auth_api:/usr/src/app/node_modules"
volumes:
auth_api:
auth:
platform: linux/amd64
container_name: auth_api
build:
context: ./backend
dockerfile: auth/Dockerfile
env_file: .env
ports:
- "4000:3000"
volumes:
- "./backend/auth:/usr/src/app/"
- "auth_api:/usr/src/app/node_modules"
volumes:
auth_api:

Dockerfile
FROM node:18-alpine

WORKDIR /usr/src/app

COPY ./auth/package*.json ./

COPY prisma ./prisma

RUN npm install

RUN npx prisma generate

COPY ./auth .

EXPOSE 3000 3000

CMD ["./startup"]
FROM node:18-alpine

WORKDIR /usr/src/app

COPY ./auth/package*.json ./

COPY prisma ./prisma

RUN npm install

RUN npx prisma generate

COPY ./auth .

EXPOSE 3000 3000

CMD ["./startup"]
Prisma Schema
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
I've attempted all the solutions from previous comments, I even tried using "linux-musl-arm64-openssl-3.0.x" instead of "linux-musl-openssl-3.0.x" as suggested from someone in the GitHub thread.
2 replies
RRailway
Created by angelplusultra on 11/11/2023 in #✋|help
Cold Start Issue
Hello, I recently deployed a NodeJS server on Railway that acts as the backend to a React App that I'm hosting on Vercel, but I'm facing an issue of the server going to sleep after enough time passes by with inactivity. How can I fix this? The server needs to be ready to serve content at all times.
28 replies
RRailway
Created by angelplusultra on 5/13/2023 in #✋|help
Server Slow To Startup on Railway
I have a node server deployed on railway and whenever my frontend makes calls to it the first request is always a failure and then if I refresh and try again then it works. I'm new to web development so I don't exactly know what's causing this but maybe the server is just slow to start up? If anyone knows, what are my options to fix this issue?
8 replies