Replies: 28 comments 27 replies
-
(Notes from another report of this #19564 (comment)) |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Yes. I'm using AWS Lambda and Prisma does not search the Lambda task root, and none of the paths Prisma searches are available to copy files. Which package manager are you using? npm@9.6.3 Is your workspace a monorepo setup? No, it's pretty standard https://arc.codes repo Is a bundler in use? If yes, which one? esbuild via architect/plugin-typescript Is a framework in use? If yes, which one? Yes, https://arc.codes Your project uses TypeScript or just JavaScript? TypeScript When you saw our message, did it happen locally or in deployment? After deployment, in the Lambda execution environment Where is your project deployed? AWS Lambda |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?Our error message suggested you to copy the engine somewhere. How did that go? Which package manager are you using?For instance npm, pnpm, or yarn. Please attach the version if you know it. I prefer use the pnpm. But recently i found many lib not support the pnpm. I had to rollback my project. It's suck. Is your workspace a monorepo setup?Is your setup hosting multiple packages in a single workspace? Is a bundler in use? If yes, which one?Are you using webpack, swc, esbuild, rollup, or any other bundler? Is a framework in use? If yes, which one?Are you using Next.js, Next, or any other framework? Your project uses TypeScript or just JavaScript?Do you prefer using TypeScript or JavaScript within your project, or both? perfer using TypeScript. When you saw our message, did it happen locally or in deployment?The message was "Please help us by answering a few questions". On my local environment. I try to use the pkg build a single execute file. Where is your project deployed?Are you deploying to Vercel, Netlify, Lambda, or something else? I still in the develop this project. I will deploy on the factory window PC. So I had to build a single executable file. Finally. Can you support me on the pkg build Prisma project issue? |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?Trying to avoid that right now, as this is only happening in production/deployment. Will update here if/when we try that. Which package manager are you using?yarn v1.22.19 Is your workspace a monorepo setup?Yes, however hoisting for prisma has already been disabled due to past issues. Is a framework in use? If yes, which one?Next.js 13 Your project uses TypeScript or just JavaScript?TypeScript When you saw our message, did it happen locally or in deployment?Deployment Where is your project deployed?AWS ECR |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?Worked perfectly, but of course, the bundler should just get it right. Which package manager are you using?Used yarn, but tried with npm, too Is your workspace a monorepo setup?Single workspace here Is a bundler in use? If yes, which one?Using Is a framework in use? If yes, which one?No framework Your project uses TypeScript or just JavaScript?TypeScript When you saw our message, did it happen locally or in deployment?The message was "Please help us by answering a few questions". Happened locally during setting up a fresh project on a Windows machine Where is your project deployed?Are you deploying to Vercel, Netlify, Lambda, or something else? No deployment yet |
Beta Was this translation helpful? Give feedback.
-
Here is an issue that triggers a link to this discussion: #22142 |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?Copied (rhel-openssl-3.0.x) and existing in lamda zip, but still not working Which package manager are you using?pnpm@8.12.0 Is your workspace a monorepo setup?Yes Is a bundler in use? If yes, which one?webpack Is a framework in use? If yes, which one?nestjs 10 Your project uses TypeScript or just JavaScript?TypeScript When you saw our message, did it happen locally or in deployment?deployment Where is your project deployed?AWS Lamda |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Note: |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? |
Beta Was this translation helpful? Give feedback.
-
I don't know but if this is a solution but using turborepo with pnpm workspaces, I added a script to the prisma package, and in the root directory I ran the following pnpm --filter @workspace/prisma prisma:reset
pnpm --filter @workspace/prisma prisma:migrate-dev This is from the "scripts": {
"build": "prisma generate",
"format": "prisma format",
"post-install": "prisma generate",
"prisma:generate": "prisma generate",
"prisma:migrate-dev": "prisma migrate dev",
"prisma:migrate-deploy": "prisma migrate deploy",
"prisma:seed": "prisma db seed",
"prisma:studio": "prisma studio",
"prisma:reset": "prisma migrate reset"
}, |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is your setup hosting multiple packages in a single workspace? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed?
This can help us better understand where the engine was searched for |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Nope.. I am only having this issue on Vercel PREVIEW deployments. for some reason it is working on production Which package manager are you using? pnpm@8.15.0 on local dev environment. I don't know what vercel is using when I deploy it there on preview Is your workspace a monorepo setup? Yep. TurboRepo monorepo; Is a bundler in use? If yes, which one? next bundler? I think they use webpack idk Is a framework in use? If yes, which one? NextJs Your project uses TypeScript or just JavaScript? TypeScript When you saw our message, did it happen locally or in deployment? Vercel PREVIEW deployments. for some reason it is working on production. Where is your project deployed? Vercel serverless function |
Beta Was this translation helpful? Give feedback.
-
UPDATE: I was able to solve this by putting the following in my github action. Without that, it would stop at "native" and only pick up env:
PRISMA_CLI_BINARY_TARGETS: 'debian-openssl-3.0.x' I'm having trouble making my github action build -> google cloud function work. My
However, after having the github action run The two engine files that are available are in the Oddly when I run
I need to build the project on a different platform (github actions) than the run is happening (google cloud function), so it's very problematic that there's no Is there a way I can get this engine via the prisma CLI or soemthing, during my build step? I didn't see a way to do this in the prisma CLI, but maybe just missed it. Have you tried to copy the engine in the suggested location? Did that work?I can't, it's not available in the github action environment Which package manager are you using?Yarn Is your workspace a monorepo setup?Yes Is your setup hosting multiple packages in a single workspace?No, the google cloud function is not Is a bundler in use? If yes, which one?Yes, it's a custom one we wrote, so we can copy in the engine files ourselves... if they were the right version Is a framework in use? If yes, which one?Sort of... the google cloud "framework" Your project uses TypeScript or just JavaScript?Typescript When you saw our message, did it happen locally or in deployment?Deployment Where is your project deployed?
Paste the error message
|
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?We specify the prisma output as
The error states:
So when we copy the engine to /usr/src/app it works Which package manager are you using?npm Is your workspace a monorepo setup?We build these files from an Nx monorepo which is why we're trying to output to a relative directory inside the project. Everything works locally. Is a bundler in use? If yes, which one?Webpack through the @nx/webpack plugin with the following config
Is a framework in use? If yes, which one?NestJS Your project uses TypeScript or just JavaScript?Typescript When you saw our message, did it happen locally or in deployment?Only in our deployed container which uses the following entrypoint script
Where is your project deployed?EKS Paste the error messageError Logs
|
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?
The error is:
Which package manager are you using?For instance npm, pnpm, or yarn. Please attach the version if you know it.
Is your workspace a monorepo setup?Is your setup hosting multiple packages in a single workspace?
Is a bundler in use? If yes, which one?Are you using webpack, swc, esbuild, rollup, or any other bundler?
Build pipeline?
Is a framework in use? If yes, which one?Are you using Next.js, Next, or any other framework?
Your project uses TypeScript or just JavaScript?
Do you prefer using TypeScript or JavaScript within your project, or both?
When you saw our message, did it happen locally or in deployment?
Where is your project deployed?Are you deploying to Vercel, Netlify, Lambda, or something else?
Paste the error messageThis can help us better understand where the engine was searched for:
Our error message suggested you to copy the engine somewhere. How did that go?
Copy-from:
Different copy-to attempts:
This is accomplished with the copyStaticFiles plugin for esbuild:
The last target location, "/.esbuild/.build/prisma/libquery_engine-rhel-openssl-3.0.x.so.node"
The .esbuild/.build/prisma directory appears to be the right location to put the libquery_engine-rhel-openssl-3.0.x.so.node file, but there appears to be something else missing! Since we are building nine prisma clients I am not sure what to copy where since it probably doesn't make sense to copy ever generated prisma client to the same directory! The question that comes to mind is: "Why does it work locally, but not in AWS?". The bundler is the same in both places. How the serverless framework deploys the bundled code is also possibly involved. We are using a serverless framework "pruning" plugin for deployment, after removing that from the deployment we get:
Which looks like prisma can't find the pem file. I remembered that the api's require that file also in the prisma directory. Copying the
I think the pruning plugin was just changing the output of the error to yield more information. After putting it back the code continues to work. SolutionIn the end, for us, the solution is to have the bundler create a
If you are using a different bundler, you probably just need to find out where the root folder is and replace |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Yes, I'm using webpack. Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Paste the error message
This can help us better understand where the engine was searched for |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work?
=> It seems both are not on the same os. Solution:
Alternative solution:
Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Paste the error message 2024-04-20 22:38:53.699 |
Beta Was this translation helpful? Give feedback.
-
I just tried first setting a output param in the schema file, then installing the nextjs monorepo workaround package
npm
Monorepo
webpack
Next.js
TypeScript
It happened in my deployed backend. I had to look at the logs in the cloud.
Firebase
Edited logs from the cloud.
|
Beta Was this translation helpful? Give feedback.
-
We get this error if we don't copy For reference, here's our client definition in
We are copying the engine we want to use, but prisma tries using a different one (see error message).
yarn 1.3
Yes
esbuild in this case
No
TypeScript?
In the deployment
Yes, in AWS Lambdas and ECS
|
Beta Was this translation helpful? Give feedback.
-
I am trying to centralize the Prisma schema in a microservice-type application. I followed this article: https://medium.com/@nolawnchairs/sharing-prisma-between-multiple-applications-5c7a7d131519. So I have one application called 'rapporto-prisma' and another appliaction called 'frontend' (which is a nextjs application). The 'rapporto-prisma' contains the prisma migrations and schema, and an index.js that simply re-exports the prisma client. Everything is in a npm workspace, so 'frontend' can import from 'rapporto-prisma', but 'frontend' is not able to find the Query Engine. It searches the following locations:
I thought it was quite odd that it is searching I copied the engine file from
Yes, and it worked
I just copied
version 10.7, yes monorepo
Yes there are multiple npm packages if that is what you are asking. Using whatever bundler nextjs uses (I think webpack)
nextjs
typescript
locally
not deployed
no |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Paste the error message Prisma Client could not locate the Query Engine for runtime "darwin". This is likely caused by a bundler that has not copied "libquery_engine-darwin.dylib.node" next to the resulting bundle. We would appreciate if you could take the time to share some information with us. The following locations have been searched: |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is your setup hosting multiple packages in a single workspace? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? Do you prefer using TypeScript or JavaScript within your project, or both? When you saw our message, did it happen locally or in deployment? The message was "Please help us by answering a few questions". Where is your project deployed? Paste the error message |
Beta Was this translation helpful? Give feedback.
-
@danomatic same issue as you and created a PR to fix it: #24941 |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Paste the error message
I tried two solutions:
Note: It crashes while importing prisma on server actions. |
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Paste the error message
|
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Hi, I recently created a new project using the new version of serverless (4) and I decided to use prisma as I usually do but when I run my sls comand to test a simple endpoint I get the following problem:
|
Beta Was this translation helpful? Give feedback.
-
Have you tried to copy the engine in the suggested location? Did that work? Our error message suggested you to copy the engine somewhere. How did that go? Is your workspace a monorepo setup? Is your setup hosting multiple packages in a single workspace? Is a framework in use? If yes, which one? Next js Your project uses TypeScript or just JavaScript? Typescript When you saw our message, did it happen locally or in deployment? On AWS lambda console. The message was "Please help us by answering a few questions". Amplify / AWS Lambda "errorType": "PrismaClientInitializationError", This can help us better understand where the engine was searched for |
Beta Was this translation helpful? Give feedback.
-
Hi, you have been directed to this discussion because we want to learn more about your project setup. Thanks to your answers, we will be able to make better design decisions in the future.
We'd appreciate it if you could take 5 minutes to answer a few questions for us. You can write your reply directly in this discussion as a comment. Copy and paste these questions in your answer, and leave the answer blank if you don't know.
Have you tried to copy the engine in the suggested location? Did that work?
Our error message suggested you to copy the engine somewhere. How did that go?
Which package manager are you using?
For instance
npm
,pnpm
, oryarn
. Please attach the version if you know it.Is your workspace a monorepo setup?
Is your setup hosting multiple packages in a single workspace?
Is a bundler in use? If yes, which one?
Are you using
webpack
,swc
,esbuild
,rollup
, or any other bundler?Is a framework in use? If yes, which one?
Are you using
Next.js
,Next
, or any other framework?Your project uses TypeScript or just JavaScript?
Do you prefer using TypeScript or JavaScript within your project, or both?
When you saw our message, did it happen locally or in deployment?
The message was "Please help us by answering a few questions".
Where is your project deployed?
Are you deploying to Vercel, Netlify, Lambda, or something else?
Paste the error message
This can help us better understand where the engine was searched for
Beta Was this translation helpful? Give feedback.
All reactions