-
-
Notifications
You must be signed in to change notification settings - Fork 401
Bug: @module-federation/utilities entry points are broken in v3.1.84 after rslib migration #4434
Description
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.2Validations
- Read the docs.
- Read the common issues list.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Module federation issue and not a framework-specific issue.
- The provided reproduction is a minimal reproducible example of the bug.