Skip to main content
Version: 4.x

EXP3002: Validation package is not available

Raised as an error when a class declares rules, in every environment. Printed as a development warning when it declares none.

Validation with class-validator needs two packages: class-validator and class-transformer. One of them could not be loaded. The usual cause is installing class-validator alone; it does not depend on the other.

CreateUserDto declares validation rules, but class-transformer could not be loaded, so the rules cannot be applied.
Why: accepting the value unchecked would let through what the rules forbid, so the request is refused.
Fix: install class-validator and class-transformer in the application.
Code: EXP3002

A request for a class that declares rules is answered with 500. Until 4.4.0 such a request was accepted unchecked, with a warning in development and nothing in production. A class that declares no rules has nothing to apply and is served as before.

Fix​

npm install class-validator class-transformer

All codes are listed under Error responses.