#Vercel with Prisma in a Turborepo deploy

1 messages ยท Page 1 of 1 (latest)

tender citrus
#

I've been trying to correct this problem for a good day now. Without success

I've tested everything I've seen on Github, what's been suggested via AIs etc. Nothing fixes this problem.
I have deployed the prisma & turbo template they provide and it magically deploys without a hitch and I have no errors in the logs.

I don't understand

Does anyone have an idea?

{
  "$schema": "https://turbo.build/schema.json",
  "ui": "tui",
  "tasks": {
    "build": {
      "dependsOn": ["^build", "^db:generate"],
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "outputs": ["dist/**", ".next/**", "!.next/cache/**"],
  "scripts": {
    "db:generate": "npx prisma generate --schema ./prisma",
    "db:migrate": "npx prisma migrate dev --skip-generate",
    "db:deploy": "npx prisma migrate deploy"
  },
grim sinewBOT
#

๐Ÿ”Ž This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

๐Ÿ•ต๏ธ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

โœ… You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

dusty parrot
#

Same issue here, seems to be a known issue and Prisma (from what I can tell) is silent on it. The problem is the custom output path, if you remove that and export from @prisma/client instead it works (albeit with your console being flooded with Package @prisma/client can't be external warnings). The thing is that Prisma 7 will require custom output paths, so this is a temporary hack fix to get things running at best

See: https://www.answeroverflow.com/m/1361918134927229039

Repo: https://github.com/DarkstarXDD/interactive-card-details-form
Live site: https://interactive-card-details-form-darkstarxdd.vercel.app/

Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".

Hi, I get this error when i deploy the project to Vercel. (Let me know if you need the full error message i can send it)
...

#

Extremely frustrating and I've wasted half a day on it myself, I loved Prisma initially but these kinds of problems keep popping up and I wish I went with a different ORM at this point but it's too late to switch

dusty parrot
#

Modify your schema.prisma to remove everything from generator client except provider. Next, modify your index.ts/client.ts and change all instances of ../generated/prisma to @prisma/client. Next, add public-hoist-pattern[]=*prisma* to your .npmrc. Finally, run pnpm install and pnpm db:generate

#

This is a stupid fix because custom output will be required for prisma 7 anwyays, but it will get things running for now

#

I'm not wasting any more time on this lolsob

tender citrus
#

my files:

dusty parrot
#

instead of ./client

#

e.g.

export {prisma} from "./client";
export * from "@prisma/client";
export type {JsonObject, JsonArray} from "@prisma/client/runtime/library";
tender citrus
#

@dusty parrot always the problem...

dusty parrot
#

If your root directory is a sub-package, try this

#

Essentially running the commands at the root instead of in a subdirectory

#

e.g. if you have something like this configured

tender citrus
#

Actually ๐Ÿ˜…

dusty parrot
#

Yeah so you would have to cd ../../

#

try that

#

I also don't have @prisma/client or prisma defined in my dependencies in the root package.json, you could try that

#

It should hoist them from your packages/database

tender citrus
#

like that?

dusty parrot
tender citrus
#

๐Ÿ˜ญ

#

I think downgrade to prisma 5 as better option ๐Ÿ˜ญ ๐Ÿ˜“

dusty parrot
#

The postinstall script automatically ran prisma generate, which failed.

#

I'm not sure if any of this matters, I'm just comparing our code. I don't have a postinstall script for Prisma, and using npx instead of just running prisma generate might be an issue?

#

You shouldn't need it seeing as running either build or dev will also run db:generate

tender citrus
#

I'm going to try this

dusty parrot
#

But those postinstall errors are odd

tender citrus
dusty parrot
#

That definetly looks better

#

Oh

#

Is this running with servless functions?

#

Actually I think now I'm confused

#

That should be fine

tender citrus
dusty parrot
#

Only reason I bring it up is because my error was query-engine-rhel-openssl-3.0.x whereas your is query-engine-rhel-openssl-3.0.x.so.node

dusty parrot
#

You could try removing any prisma stuff out of your root package.json?

#

That .so.node is the only difference in the error message

#

from mine

tender citrus
#

but i trying this

#

No red errors

dusty parrot
#

Is it working?

tender citrus
#

Yes, it works. The only errors I have are related to authentication, I misconfigured the URL callbakc, but otherwise it works.

Thanks a lot!

dusty parrot
#

No worries, glad it works!

#

I'd leave this thread open as the root issue still isn't solved, something wrong with Prisma/Vercel with custom output

tender citrus
#

Yes totally