PrismaClientKnownRequestError: Invalid prisma.b2bTransaction.findUnique()
prisma table B2bTransaction exists in database cross-checked with the studio, but when try to use in hono on production, it gives this error:
table schema
target code:
prisma version:
"@prisma/client": "^5.22.0",
5 Replies
Is
npx prisma generate
a part of your deployment script?
Did you run npx prisma migrate deploy
in your production environment to apply any pending migrations?i am deploying this on hono
so i have did all npx prisma generate, db push, db deploy
but it still gives this error in production meanwhile in local development it works fine
this is a part of turborepo monorepo and i am deploying via wrangler CLI
Did you add
B2bTransaction
table recently, or was it already a part of database before?Also, I see you have submitted a GitHub Issue recently:
https://github.com/prisma/prisma/issues/25913
GitHub
PrismaClientKnownRequestError: Invalid `prisma.b2bTransaction.findU...
Bug description prisma table B2bTransaction exists in database cross-checked withthe studio also but when try to use in hono on production gives this error: PrismaClientKnownRequestError: Invalid `...
i have 2 table like this b2b and p2p i made both of them together a while back and this is the first time i am using b2b in prod environment.
closing this as the issue is resolved.
Just wanna say humans can be so stupid sometimes the problem was I have 2 URL's
DATABASE_URL
and UNPOOLED_DATABASE_URL
so what was happening here is the database neon provided by default is there's /neon
and I was using a different one for my project and somehow I copied neon's
db in DATABASE_URL
and UNPOOLED_DATABASE_URL
is using my correct URL.
but locally I have 2 envs and the one which I am using locally for all shared packages has the correct URL
but my .dev.vars
got the wrong one which was propagating to Cloudflare.
Thanks