Nest: [PackageLoader] The "class-transformer" error reopen issue for nest 6.2.2

Created on 24 May 2019  路  4Comments  路  Source: nestjs/nest

Most helpful comment

I'm using NestJs 6.0.0 and importing ValidationPipe on main.ts as
import { ValidationPipe } from '@nestjs/common';

I receive the following error:
The "class-transformer" package is missing. Please, make sure to install this library ($ npm install class-transformer) to take advantage of ValidationPipe.

On the documentation page there is only mention that the class-validator package is used so I believe that this package is installed by default with NestJS.

The class-transformer package is an extension mentioned by class-validator GitHub page and after installing it npm install class-transformer the error was fixed.

Since ValidationPipe requires the class-transformer package I believe it should be listed as a dependency of NestJS or at least mentioned on the validation documentation page.

All 4 comments

It's not an issue. class-transformer is and will always be required if you use ValidationPipe

@kamilmysliwiec I think should specify this clearly here https://docs.nestjs.com/techniques/validation

I'm using NestJs 6.0.0 and importing ValidationPipe on main.ts as
import { ValidationPipe } from '@nestjs/common';

I receive the following error:
The "class-transformer" package is missing. Please, make sure to install this library ($ npm install class-transformer) to take advantage of ValidationPipe.

On the documentation page there is only mention that the class-validator package is used so I believe that this package is installed by default with NestJS.

The class-transformer package is an extension mentioned by class-validator GitHub page and after installing it npm install class-transformer the error was fixed.

Since ValidationPipe requires the class-transformer package I believe it should be listed as a dependency of NestJS or at least mentioned on the validation documentation page.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings