skip to Main Content

This is the error message I got in the terminal: "TypeError: The "payload" argument must be of type object. Received null"

I am trying to fetch user data like so:

const user = await prisma.user.findMany({
  orderBy: {
    id: 'desc'
  }
});

2

Answers


  1. Chosen as BEST ANSWER

    The solution was to import PrismaClient from @prisma/client instead of @prisma/client/edge.

    import { PrismaClient } from '@prisma/client';


  2. Got the same error today. but I am using @prisma/client already.Guess this issue is related to nextjs 15. Can anyone help?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search