PrismaP
Prisma2y ago
3 replies
infinity

Getting P2023 When getting params

I am getting this error message when getting params with the id:
code: 'P2023',
  clientVersion: '5.17.0',
  meta: {
    modelName: 'User',
    message: 'Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got: "undefined", length 9.'
  }
}
 GET /api/users/undefined 500 in 649ms
{
  message: 'Failed to fetch user',
  error: {
    name: 'PrismaClientKnownRequestError',
    code: 'P2023',
    clientVersion: '5.17.0',
    meta: {
      modelName: 'User',
      message: 'Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got: "undefined", length 9.'
    }
  }
}
Was this page helpful?