nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.69k stars 2.36k forks source link

angular and nestjs shared library esbuild vs nestjs build settings #23374

Open robc123 opened 6 months ago

robc123 commented 6 months ago

Documentation issue

Is there a specific documentation page you are reporting?

Enter the URL or documentation section here.

Additional context or description

Provide any additional details here as needed.

Before switch to esbuild, both angular and nestjs serve and build ok. After switch angular project.json to esbuild then nestjs reports error Cannot access EntityClassBO before initialization. This BO is defined with nestJS class-transformer decorators e.g. @Expose() and @Type Similarly DTO classes use class-validator decorators e.g. @IsBoolean()

Research on NestJs issues shows that esbuild cannot handle decorators and using tsconfig settings to suit this is not supported. NestJs issues have no idea of NX context of api app.

Ideally NX Documentation would show how to setup the nestjs api project.json so that it will independently build the shared library to revert to the same output as the previous method, this output location for api serve during debug would need to be independent of the output location for angular serve during debug done by esbuild(vite?). API build would need to do the same, build the shared lib with webpack (I'm not 100% sure if that is how the lib was built by the old angular serve/ build executor setting: @angular-devkit/build-angular:browser)

Thanks Rob

github-actions[bot] commented 4 days ago

This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏