Skip to content

@module-federation/dts-plugin Yarn pnp support #4188

@WooWan

Description

@WooWan

Describe the bug

Failed to generate type declaration

Error

[ Module Federation DTS ] Error: Failed to generate type declaration. #TYPE-001
args: {"cmd":"npx tsc --project '/Users/changwan/Desktop/some-project/node_modules/.federation/tsconfig.4fec54e86f8ecdc7aaffd273a8cf73d4.json'"}
    at fork-generate-dts.js:416:13
    at Generator.next (<anonymous>)
    at fulfilled (fork-generate-dts.js:66:24)

Environment

  • Plugin: @module-federation/[email protected]
  • Package Manager: Yarn with PnP/virtual packages

Context

Error occurs during DTS generation in a Yarn PnP environment. May be related to path resolution or tsconfig generation for virtual packages.

Reproduction

You could reproduce dts-plugin pnp related error, when you start a dev server in yarn pnp repository. Or you could simply reproduct a error by executing npx tsc command in yarn pnp environment.

Used Package Manager

yarn

System Info

System:
    OS: macOS 14.4
    CPU: (16) arm64 Apple M3 Max
    Memory: 295.66 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - /Users/changwan/.local/share/mise/installs/node/22.11.0/bin/node
    Yarn: 4.9.2 - /Users/changwan/.local/share/mise/installs/node/22.11.0/bin/yarn
    npm: 10.9.0 - /Users/changwan/.local/share/mise/installs/node/22.11.0/bin/npm
    bun: 1.2.19 - /Users/changwan/.bun/bin/bun
  Browsers:
    Chrome: 141.0.7390.123
    Safari: 17.4

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions