Skip to content

fix(dts-plugin): use default import for fs-extra to fix ESM compatibility#4504

Merged
zhoushaw merged 2 commits intomodule-federation:mainfrom
Staremang:fix/import-fs-extra
Mar 8, 2026
Merged

fix(dts-plugin): use default import for fs-extra to fix ESM compatibility#4504
zhoushaw merged 2 commits intomodule-federation:mainfrom
Staremang:fix/import-fs-extra

Conversation

@Staremang
Copy link
Copy Markdown
Contributor

Description

Replace named imports from fs-extra with default import + destructuring in the @module-federation/dts-plugin package.

fs-extra is a CommonJS module and does not support named exports when imported from an ESM context via Node.js native module resolver. This causes a SyntaxError: Named export 'existsSync' not found. at runtime.

Related Issue

#4503

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: 187972f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 43 packages
Name Type
@module-federation/dts-plugin Patch
@module-federation/cli Patch
@module-federation/enhanced Patch
@module-federation/manifest Patch
@module-federation/metro Patch
@module-federation/rspack Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 5, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 187972f
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69adffc3e9e7e80008f1870d
😎 Deploy Preview https://deploy-preview-4504--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zhoushaw zhoushaw merged commit 079aecd into module-federation:main Mar 8, 2026
3 of 4 checks passed
@2heal1 2heal1 mentioned this pull request Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants