I’ve been following these guides for implementing a preview environment with Neon branches and Vercel previews.
However, when I try to use Prisma I encounter this error.
The error in Vercel logs is as follows.
…sl-1.0.x\"]\n}\n\nThe following locations have been searched:\n /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/.prisma/client\n /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client\n /home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client\n /tmp/prisma-engines","reason":{"errorType":"PrismaClientInitializationError","errorMessage":"Prisma Client could not locate the Query Engine for runtime \"rhel-openssl-1.0.x\".\n\nThis happened because Prisma Client was generated for \"debian-openssl-1.1.x\", but the actual deployment required \"rhel-openssl-1.0.x\".\nAdd \"rhel-openssl-1.0.x\" to `binaryTargets` in the \"schema.prisma\" file and run `prisma generate` after saving it:\n\ngenerator client {\n provider = \"prisma-client-js\"\n binaryTargets = [\"native\", \"rhel-openssl-1.0.x\"]\n}\n\nThe following locations have been searched:\n /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/.prisma/client\n /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client\n /home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client\n /tmp/prisma-engines","name":"PrismaClientInitializationError","clientVersion":"5.4.2","stack":["PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime \"rhel-openssl-1.0.x\".","","This happened because Prisma Client was generated for \"debian-openssl-1.1.x\", but the actual deployment required \"rhel-openssl-1.0.x\".","Add \"rhel-openssl-1.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-1.0.x\"]","}","","The following locations have been searched:"," /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/.prisma/client"," /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client"," /home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client"," /tmp/prisma-engines"," at Ca (/var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client/runtime/library.js:65:776)"," at async fn.loadLibrary (/var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client/runtime/library.js:112:9777)"," at async mr.loadEngine (/var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client/runtime/library.js:114:447)"," at async mr.instantiateLibrary (/var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client/runtime/library.js:113:1762)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime \"rhel-openssl-1.0.x\".","","This happened because Prisma Client was generated for \"debian-openssl-1.1.x\", but the actual deployment required \"rhel-openssl-1.0.x\".","Add \"rhel-openssl-1.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-1.0.x\"]","}","","The following locations have been searched:"," /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/.prisma/client"," /var/task/home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client"," /home/runner/work/ctfalcon-new/ctfalcon-new/node_modules/@prisma/client"," /tmp/prisma-engines"," at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)"," at process.emit (node:events:529:35)"," at emit (node:internal/process/promises:149:20)"," at processPromiseRejections (node:internal/process/promises:283:27)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]} Unknown application error occurred Runtime.Unknown
I’ve tried to add preview-specific environment variables to the cloud on a specific Vercel branch with the Vercel CLI but I can’t connect a Git repository because the Git repository is in an organization and I need the team subscription for that. I have added prod environment variables to the cloud.
Is this because the workflows don’t add the DATABASE_URL and DIRECT_URL to the app?