Bibhushan Thapa
Bibhushan Thapa
Explore posts from servers
PPrisma
Created by Bibhushan Thapa on 6/12/2024 in #help-and-questions
Hosting Typescript Express Server with Prisma on Vercel
For work around I copied the generate file inside the dist build folder Now It is detecting the prisma but I am getting this error:
Unhandled Rejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".
This happened because Prisma Client was generated for "windows", but the actual deployment required "rhel-openssl-3.0.x".
Add "rhel-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", "rhel-openssl-3.0.x"]
}

Unhandled Rejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".
This happened because Prisma Client was generated for "windows", but the actual deployment required "rhel-openssl-3.0.x".
Add "rhel-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", "rhel-openssl-3.0.x"]
}

3 replies
PPrisma
Created by Bibhushan Thapa on 6/12/2024 in #help-and-questions
Hosting Typescript Express Server with Prisma on Vercel
tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"allowSyntheticDefaultImports": true,
"noImplicitReturns": false,
"noImplicitAny": true,
"resolveJsonModule": true,
"types" : ["node", "express"]
},
"include": ["src/**/*.ts", "src/generated/prismaClient/**/*.ts"],
"exclude": ["node_modules", "**/*.test.ts", "cypress", "docs", "scripts", "test"]
}
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"allowSyntheticDefaultImports": true,
"noImplicitReturns": false,
"noImplicitAny": true,
"resolveJsonModule": true,
"types" : ["node", "express"]
},
"include": ["src/**/*.ts", "src/generated/prismaClient/**/*.ts"],
"exclude": ["node_modules", "**/*.test.ts", "cypress", "docs", "scripts", "test"]
}
vercel.json
{
"version": 2,
"builds": [
{
"src": "dist/server.js",
"use": "@vercel/node",
"config": {
"includeFiles": [
"dist/**"
]
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/server.js",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"OPTIONS"
],
"headers": {
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,OPTIONS,PATCH,DELETE,POST,PUT",
"Access-Control-Allow-Headers": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version"
}
}
]
}
{
"version": 2,
"builds": [
{
"src": "dist/server.js",
"use": "@vercel/node",
"config": {
"includeFiles": [
"dist/**"
]
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/server.js",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"OPTIONS"
],
"headers": {
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,OPTIONS,PATCH,DELETE,POST,PUT",
"Access-Control-Allow-Headers": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version"
}
}
]
}
3 replies