-
-
Notifications
You must be signed in to change notification settings - Fork 400
Open
Description
Describe the bug
When @module-federation/dts-plugin is executed in an ESM context (e.g. Node.js workers, direct execution with "type": "module"), it throws:
import fse, { ensureDirSync, existsSync, writeFileSync } from "fs-extra";
^^^^^^^^^^
SyntaxError: Named export 'existsSync' not found. The requested module 'fs-extra' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'fs-extra';
const { ensureDirSync, existsSync, writeFileSync } = pkg;Reproduce
- @module-federation/vite 1.12.0
- ESM module resolution
Reproduction
Internal repo with a patch
Used Package Manager
pnpm
System Info
System:
OS: macOS 26.3
CPU: (14) arm64 Apple M4 Pro
Memory: 1.08 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.10.0 - /opt/homebrew/bin/node
npm: 11.6.0 - /opt/homebrew/bin/npm
pnpm: 9.12.2 - /opt/homebrew/bin/pnpm
Browsers:
Safari: 26.3Validations
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels