Missing emitDecoratorMetadata=true for NestJS projects when using Angular workspace #1996
Labels
community
This is a good first issue for contributing
outdated
scope: node
Issues related to Node, Express, NestJS support for Nx
type: enhancement
Expected Behavior
When adding a new NestJS application to an Angular workspace using the application schematic from the @nrwl/nest package, the application should work out of the box.
Current Behavior
The created app does not work properly. First, it looks like everything is working fine. But as soon as typical NestJS decorators are used, unexpected behaviour can happen. For example, when adding the ValidationPipe using
@UsePipes(...)
no validation is performed at all. This is because the tsconfig.json files does not contain emitDecoratorMetadata=true.Failure Information (for bugs)
When using an Angular workspace - no NX workspace - emitDecoratorMetadata is not set by default since Angular 8.1 (see #1801). But emitDecoratorMetadata=true is required for NestJS applications to run properly, as described above.
Either the workspace-schematic or the NestJS application schematic should update the tsconfig accordingly.
I could provide a PR if you tell where I should add this (workspace or NestJS application schematic) and which tsconfig should be updated: in my opinion the app's tsconfig should be updated, not the global one in the root folder.
Steps to Reproduce
@UsePipes
The text was updated successfully, but these errors were encountered: