Bug description
PrismaClientKnownRequestError: \nInvalid `prisma.audit.findFirst()` invocation:\n\n\nInput error. The 'findFirst' operation cannot be used with a 'take' argument that isn't 1
model.findFirst({ ..., take: -1 });
Severity
🚨 Critical: Data loss, app crash, security issue
Reproduction
Just try findFirst with take: -1
Expected vs. Actual Behavior
Expected: No error
Actual: Error
Frequency
Consistently reproducible
Does this occur in development or production?
Production and development
Is this a regression?
I'm not sure, but it seems to have worked before version 6.9.0.
Workaround
IDK
Prisma Schema & Queries
model Audit {
id Bytes @id @database.ByteA
}
await Audit.findFirst({
...findConditions,
skip: 0,
take: before ? -1 : 1,
});
Prisma Config
import { join } from 'node:path';
import 'dotenv/config';
import type { PrismaConfig } from 'prisma';
export default {
schema: join('sources', 'domains'),
migrations: {
path: join('sources', 'migrations'),
},
} satisfies PrismaConfig;
Logs & Debug Info
PrismaClientKnownRequestError: \nInvalid `prisma.audit.findFirst()` invocation:\n\n\nInput error. The 'findFirst' operation cannot be used with a 'take' argument that isn't 1
Environment & Setup
- OS: MacOs, Windows, Linux Alpine
- Database: PostgreSQL
- Node.js version: 22 LTS
Prisma Version
Bug description
Severity
🚨 Critical: Data loss, app crash, security issue
Reproduction
Just try findFirst with
take: -1Expected vs. Actual Behavior
Expected: No error
Actual: Error
Frequency
Consistently reproducible
Does this occur in development or production?
Production and development
Is this a regression?
I'm not sure, but it seems to have worked before version 6.9.0.
Workaround
IDK
Prisma Schema & Queries
Prisma Config
Logs & Debug Info
Environment & Setup
Prisma Version