Skip to content

fix(enhanced): resolve package names in runtimePlugins - #4954

Open
dmchoi77 wants to merge 1 commit into
module-federation:mainfrom
dmchoi77:fix/runtime-plugin-package-resolution
Open

fix(enhanced): resolve package names in runtimePlugins#4954
dmchoi77 wants to merge 1 commit into
module-federation:mainfrom
dmchoi77:fix/runtime-plugin-package-resolution

Conversation

@dmchoi77

@dmchoi77 dmchoi77 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

runtimePlugins entries provided as package names were incorrectly converted into paths relative to process.cwd(). This caused Webpack to fail before loading the runtime plugin.

This PR resolves non-absolute runtimePlugins entries with Node.js module resolution using require.resolve(entry, { paths: [cwd] }). Existing absolute-path behavior is preserved, and unresolved relative paths continue to fall back to the previous cwd-based path behavior.

The change also adds a regression test for scoped package-name resolution and a patch changeset for @module-federation/enhanced.

Related Issue

Fixes #4953

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

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5bf7f8f

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

This PR includes changesets to release 47 packages
Name Type
@module-federation/enhanced 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
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
@module-federation/playground Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin 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/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/observability-plugin 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81f3dc6af3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dmchoi77
dmchoi77 force-pushed the fix/runtime-plugin-package-resolution branch from 81f3dc6 to e045621 Compare August 3, 2026 16:47
@dmchoi77
dmchoi77 force-pushed the fix/runtime-plugin-package-resolution branch from e045621 to 5bf7f8f Compare August 3, 2026 16:54
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.

@module-federation/enhanced fails to resolve runtimePlugins package names

1 participant