Skip to content

Unresolved dtos in shared libraries in nx monorepo setup #3251

@Michsior14

Description

@Michsior14

Did you read the migration guide?

  • I have read the whole migration guide

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Potential Commit/PR that introduced the regression

#3235

Versions

8.1.1 -> 11.0.1

Describe the regression

With the changes introduced for ESM compatibility, all typescript resolutions are treated as js files which leads to build issues.
Would be nice to have it enabled as option or be able to disable it explicitly.

In the shared repo the following error is thrown during build:

> webpack-cli build node-env=development

chunk (runtime: main) main.js (main) 4.65 KiB [entry] [rendered]

ERROR in ./src/app/app.controller.ts 36:45-105
Module not found: Error: Can't resolve '../../../../libs/dtos/src/lib/simple.js' in '/home/michal/Documents/projects/nestjs-swagger-test/apps/nestjs-swagger-test/src/app'

webpack compiled with 1 error (afc0317b09423e24)
Warning: command "webpack-cli build node-env=development" exited with non-zero status code

Minimum reproduction code

https://github.com/Michsior14/nestjs-swagger-test

Expected behavior

No errors during build time in monorepo.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions