PrismaP
Prisma15mo ago
19 replies
яσчαℓтℓя

TypeError: The "payload" argument must be of type object. Received null

There's an ongoing issue in our codebase where Prisma queries that fail give the error in the title, which isn't the typical error we see in other projects. Our project is using NextJS 15.0.2 and Prisma (with neon serverless adapter) 5.22.0.

Here is the client:

import { Pool } from "@neondatabase/serverless"; import { PrismaNeon } from "@prisma/adapter-neon"; import { PrismaClient } from "@prisma/client"; const globalForPrisma = global as unknown as { prisma: PrismaClient }; function makeClient() { const neon = new Pool({ connectionString: process.env.DATABASE_URL }); const adapter = new PrismaNeon(neon); return new PrismaClient({ adapter }); } const db = globalForPrisma.prisma || makeClient(); if (process.env.NODE_ENV === "development") { globalForPrisma.prisma = db; } export default db;
Was this page helpful?