Yusuf Musa
09/21/2022, 3:36 PMPrismaClient
is not being generated. I've tried searching online and added this postinstall
script in my package.json
that does a yarn prisma generate
but I'm lost at how that all works.
For context -- I'm using Firebase Functions to schedule regular updates to update the database (Planetscale) and add new rows/prune old ones.
Not sure if the error message helps but here's what Firebase Functions returned.Austin
09/21/2022, 8:04 PMschema.prisma
file is not available to the function.Yusuf Musa
09/22/2022, 5:36 AMfirebase deploy --only functions:<FUNCTION_NAME>
`firebase.json`:
{
"functions": {
"source": ".",
"predeploy": [
"yarn build"
],
"ignore": [
"**/.env*",
"**/.secret*",
"**/*.log",
"**/node_modules/**"
]
}
}
`package.json`:
// package.json
{
...
"build": "yarn clean && node esbuild.config.js",
...
"postinstall": "prisma generate"
}
I've also tried adding cp prisma/schema.prisma dist
but was thrown another error:
PrismaClientInitializationError: Query engine binary for current platform "debian-openssl-1.1.x" could not be found. This probably happens, because you built Prisma Client on a different platform. (Prisma Client looked in "/workspace/dist/query-engine-debian-openssl-1.1.x") Searched Locations: /.prisma/client <OMITTED>/serverless/question-service/node_modules/@prisma/client /workspace /workspace/dist /workspace/dist /tmp/prisma-engines /workspace/dist You already added the platforms "darwin", "debian-openssl-1.1.x" to the "generator" block in the "schema.prisma" file as described in <https://pris.ly/d/client-generator>, but something went wrong. That's suboptimal. Please create an issue at <https://github.com/prisma/prisma/issues/new> at BinaryEngine.getPrismaPath (/workspace/dist/index.js:456:3) at async /workspace/dist/index.js:458:1912 { clientVersion: '4.3.1', errorCode: undefined }
WIth the following schema.prisma
generator client {
binaryTargets = ["native", "debian-openssl-1.1.x"]
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}
Yusuf Musa
09/22/2022, 7:16 AMVladi Stevanovic