Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

247
Visualizações
@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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda