Skip to content

Bug: @module-federation/utilities entry points are broken in v3.1.84 after rslib migration #4434

@bigslycat

Description

@bigslycat

Describe the bug

In version 3.1.84 of @module-federation/utilities, the package cannot be resolved because the package.json entry fields (main, module, types, exports) point to file paths that no longer exist after the migration to rslib.

The Issue:
Commit bd276ac migrated the build system to rslib, which changed the output directory structure:

  • Old structure (flat): dist/index.cjs.js, dist/index.esm.js
  • New structure (nested): dist/cjs/index.js, dist/esm/index.js, dist/types/index.d.ts

However, the package.json was not updated to reflect these changes and still points to the old paths.

Current package.json (broken):

{
  "main": "./dist/index.cjs.js",
  "module": "./dist/index.esm.js",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.esm.js",
      "require": "./dist/index.cjs.js"
    }
  },
  "typesVersions": {
    "*": {
      ".": [
        "./dist/index.d.ts"
      ]
    }
  }
}

Expected package.json (based on rslib.config.ts):

{
  "main": "./dist/cjs/index.js",
  "module": "./dist/esm/index.js",
  "types": "./dist/types/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/types/index.d.ts",
      "import": "./dist/esm/index.js",
      "require": "./dist/cjs/index.js"
    }
  },
  "typesVersions": {
    "*": {
      ".": [
        "./dist/types/index.d.ts"
      ]
    }
  }
}

Reproduction

In existing project:

npm install @module-federation/utilities@3.1.84
node -e "console.log(require.resolve('@module-federation/utilities'))"

Suggested fix

Please align packages/utilities/package.json entrypoints (main, module, types, exports, and likely typesVersions) with the rslib output layout (dist/cjs, dist/esm, dist/types) or restore compatibility output files in the old dist/index.* locations.

A patch release would help consumers quickly move off 3.1.84.

Used Package Manager

npm

System Info

System:
    OS: macOS 26.2
    CPU: (12) arm64 Apple M3 Pro
    Memory: 141.48 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 25.6.1 - ~/.proto/tools/node/25.6.1/bin/node
    Yarn: 4.12.0 - ~/.proto/shims/yarn
    npm: 11.9.0 - ~/.proto/tools/node/25.6.1/bin/npm
    pnpm: 10.29.3 - ~/.proto/shims/pnpm
    Watchman: 2026.01.12.00 - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: 144.1.86.148
    Chrome: 144.0.7559.133
    Safari: 26.2

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