-
-
Notifications
You must be signed in to change notification settings - Fork 376
Description
Describe the bug
Describe the bug
The exports configuration in @module-federation/bridge-react/package.json has an error for the /plugin export. The require field incorrectly points to the ES module file instead of the CommonJS file.
Current behavior (incorrect)
"./plugin": {
"types": "./dist/plugin.d.ts",
"import": "./dist/plugin.es.js",
"require": "./dist/plugin.es.js" // ← Points to ES module!
}### Expected behavior
"./plugin": {
"types": "./dist/plugin.d.ts",
"import": "./dist/plugin.es.js",
"require": "./dist/plugin.cjs.js" // ← Should point to CJS file
}### Impact
This causes SyntaxError: Unexpected token 'export' when using Jest or any CommonJS environment that tries to require('@module-federation/bridge-react/plugin').
The CJS file dist/plugin.cjs.js exists and is correct, but the exports config doesn't reference it.
Version
@module-federation/bridge-react: 0.14.3
Reproduction
- Install
@module-federation/bridge-react - Run Jest tests that import from
/plugin - Error:
SyntaxError: Unexpected token 'export'
Reproduction
ew
Used Package Manager
yarn
System Info
System:
OS: macOS 15.7.2
CPU: (12) arm64 Apple M3 Pro
Memory: 88.06 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
Yarn: 4.2.2 - ~/.nvm/versions/node/v22.14.0/bin/yarn
npm: 11.5.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
Browsers:
Chrome: 143.0.7499.147
Edge: 143.0.3650.80
Safari: 18.6Validations
- 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.