Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
@nestjs/swagger cant be used with angular

We have a monorepo with nestjs, angular and libs. In one of those libs we defined all DTOs and some of them use mapped-types from @nestjs/swagger like OmitType or PickType:

export class UserDTOCreation extends PickType(UserDTO, ['username', 'password']){}

It is fine to use these DTOs in Angular as types like:

const user: UserDTOCreation = {} as never;

The lib will not be included into the angular build. Now it would also be nice to be able to use class-transformer in the frontend so that date strings sent over the network will be transformed back to Date objects and stuff like that. But once you use plainToClass(UserDTO, dto) from class-transformer, the DTOs are not just imported as types anymore and therefore the whole DTO lib is required for the angular build including @nestjs/swagger and its dependencies. Upon building angular there are a lot of errors like this: build errors

Apperently this is because there are now some node dependencies required that don't exist in the browser.

How to fix this? I wouldn't want to include all of those polyfills and I havent found any information on where to configure resolve.fallback: { "path": false } I guess for the mapped-type functionality the node dependencies aren't even required.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!