Prisma runtime error using direct db access in parallel with Accelerate on Vercel
I want to use two paths to Postgres: Prisma Accelerate and direct for a very limited use case (mentioned below) with my Next deployment.
I get this runtime error on Vercel, not locally:
I export const
prisma
(for Accelerate) and prismaDirect
(for direct access) as follows:
Relevant build output:
more in thread...4 Replies
Continued ...
My env vars:
This all works locally, but not on Vercel. So this could be related to postinstall.
My postinstall script:
My prisma package.json scripts:
Questions:
1) Should we be able to use direct access with Accelerate?
2) Is there anything wrong with the above? Is there more I can provide to help?
My use case is to load up to 30MB into a MUI DataGrid. I could this progressively (via Accelerate without cache), but I don't want to incur excessive data costs associated with the transfer.
Thank you!
@Nurul (Prisma) @moosthuizen
When using with accelerate you need to import {PrismaClient} from '@prisma/client/edge'
Hey, apologies for the delay in getting to this thread.
You should be able to have two PrismaClient instance, one with direct database access and the other with Accelerate.
Are you still getting this error?
Pretty sure the issue you’re running into is that you have the
no-engine
flag when running npx prisma generate
. If you remove that flag, is there still an issue?