We use the https://docs.nestjs.com/openapi/cli-plugin in a nrwl-nx nestjs project.
This basically works, but the build fails, when we use this import in a DTO:
import {Temporal} from "@js-temporal/polyfill";
import Instant = Temporal.Instant;
Errormessage:
ERROR in ./apps/nest-app/src/app/my.dto.ts 7:148-257
Module not found: Error: Can't resolve '[..]\node_modules\@js-temporal\polyfill\index' in '[..]\apps\nest-app\src\app'
webpack compiled with 1 error (2182caab897fc303)
There was an error with the build. See above.
Details:
- Here is a GitHub repository to reproduce the issue: https://github.com/tmtron/nx-swagger-ts-plugin-import-issue
- When we deactivte the Nestjs typescript compiler plugin, the build is okay. So I guess the import-syntax is okay.
- When we do not use nx, but the nest-cli directly, everything works correctly (even with his import)
- see this GitHub Repo: https://github.com/tmtron/nestjs-swagger-ts-plugin
- Thus, I suppose that nx is somehow using a different webpack configuration, but I am not sure.
I'd be glad for any hints what to do next.
Maybe someone knows a workaround or has an idea where I should report an error: nestjs, nrwl-nw, webpack?