Skip to main content
Version: 4.x

EXP3001: Body type is unknown at runtime

Printed as a development warning, once, outside production. EXPRESSOTS_DEV_WARNINGS=off silences it.

Validation is on, and a handler takes its body as @body() dto: CreateUserDto. The framework finds the rules through the parameter's type, and this build did not record it, so the rules are not applied and the body is accepted unchecked.

tsc records parameter types when emitDecoratorMetadata is on. tsx and esbuild do not, so validation written this way can run after expressots build and be skipped under expressots dev.

Fix​

Name the schema or class in the decorator. It then does not depend on what the build records:

@Post("/")
create(@validatedBody(CreateUserDto) dto: CreateUserDto) {
return this.users.create(dto);
}

All codes are listed under Error responses.