Slaughtered
Slaughtered
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
oh lol it because i just using import type at dto sorry, and thanks for the response
11 replies
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
here's my main.ts
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const port = process.env.PORT ?? 3000;
const config = new DocumentBuilder()
.setTitle("Website Rajawali")
.setDescription("API Documentation")
.setVersion("0.1")
.addServer(`http://localhost:${port}`, "Local Environment")
.addBearerAuth()
.build();
const documentFactory = () => SwaggerModule.createDocument(app, config);
SwaggerModule.setup("api", app, documentFactory);

app.setGlobalPrefix("api");
app.enableCors();
app.useGlobalFilters(new HttpExceptionFilter());
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
await app.listen(port);
}
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const port = process.env.PORT ?? 3000;
const config = new DocumentBuilder()
.setTitle("Website Rajawali")
.setDescription("API Documentation")
.setVersion("0.1")
.addServer(`http://localhost:${port}`, "Local Environment")
.addBearerAuth()
.build();
const documentFactory = () => SwaggerModule.createDocument(app, config);
SwaggerModule.setup("api", app, documentFactory);

app.setGlobalPrefix("api");
app.enableCors();
app.useGlobalFilters(new HttpExceptionFilter());
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
await app.listen(port);
}
11 replies
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
oh when i was using a prisma generated type (EventCreateInput in controller and service) it work but what when wrong with my dto?
11 replies
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
Error: Invalid value for argument data: We could not serialize [object Function] value. Serialize the object to JSON or implement a ".toJSON()" method on it. data:
const data: {
title: string;
start_date: Date;
end_date: Date;
location: string;
description: string | null;
}
const data: {
title: string;
start_date: Date;
end_date: Date;
location: string;
description: string | null;
}
11 replies
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
sure i'll provide you wait there
11 replies
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
and yeah when i print an input from event.service.ts it says like this:
data: function anonymous(
) {

}
data: function anonymous(
) {

}
11 replies
PPrisma
Created by Slaughtered on 5/25/2025 in #help-and-questions
PrismaClientValidationError: Invalid ` .create()` invocation in
event.dto.ts
export class EventDto {
@IsString()
@IsNotEmpty()
@ApiProperty({
description: "The title of the event",
example: "Event Title",
})
title: string;

@IsDate()
@ApiProperty({
description: "The start date of the event",
example: "2021-01-01T00:00:00.000Z",
required: false,
})
start_date: Date;

@IsDate()
@ApiProperty({
description: "The end date of the event",
example: "2021-01-01T00:00:00.000Z",
required: false,
})
end_date: Date;

@IsString()
@ApiProperty({
description: "The description of the event",
example: "Event Description",
required: false,
})
location: string;

@IsString()
@ApiProperty({
description: "The description of the event",
example: "Event Description",
required: false,
})
description: string | null;
}
export class EventDto {
@IsString()
@IsNotEmpty()
@ApiProperty({
description: "The title of the event",
example: "Event Title",
})
title: string;

@IsDate()
@ApiProperty({
description: "The start date of the event",
example: "2021-01-01T00:00:00.000Z",
required: false,
})
start_date: Date;

@IsDate()
@ApiProperty({
description: "The end date of the event",
example: "2021-01-01T00:00:00.000Z",
required: false,
})
end_date: Date;

@IsString()
@ApiProperty({
description: "The description of the event",
example: "Event Description",
required: false,
})
location: string;

@IsString()
@ApiProperty({
description: "The description of the event",
example: "Event Description",
required: false,
})
description: string | null;
}
I have done running prisma generate and still got an error, what should i do now? thanks
11 replies