Skip to content

fix(devtools): guard invalid module info payloads#4787

Open
dmchoi77 wants to merge 1 commit into
module-federation:mainfrom
dmchoi77:fix/devtools-module-info-placeholder
Open

fix(devtools): guard invalid module info payloads#4787
dmchoi77 wants to merge 1 commit into
module-federation:mainfrom
dmchoi77:fix/devtools-module-info-placeholder

Conversation

@dmchoi77
Copy link
Copy Markdown

Description

Fixes a Chrome DevTools crash when Loading Trace is enabled and the Module Info tab is selected after refreshing the inspected page.

Invalid moduleInfo payloads such as "[undefined]" can be relayed and stored as window.__FEDERATION__.moduleInfo, then later crash the Module Info renderer when it treats the value as a module snapshot.

This change:

  • normalizes invalid module info payloads before caching them on window.__FEDERATION__
  • ignores non-object page message payloads in the message listener
  • adds regression tests for invalid module info payloads

Verified with:

  • pnpm --filter @module-federation/devtools test
  • pnpm exec turbo run build --filter=@module-federation/devtools
  • pnpm --filter @module-federation/devtools run build:devtool

Note: pnpm exec turbo run lint was attempted, but repo-wide lint currently fails in unrelated apps/node-dynamic-remote-new-version files due to existing require / module no-undef errors. The changed DevTools package has no lint task.

Related Issue

Fixes #4786

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.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 466818a
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/6a199691282f4500080ccb3d
😎 Deploy Preview https://deploy-preview-4787--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 466818a

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

This PR includes changesets to release 46 packages
Name Type
@module-federation/devtools Patch
@module-federation/runtime Patch
@module-federation/enhanced 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/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/modern-js Patch
@module-federation/modern-js-v3 Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-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/rspress-plugin 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/nextjs-mf Patch
@module-federation/node Patch
@module-federation/observability-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/utilities Patch
remote5 Patch
remote6 Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
website-new Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote 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

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.

Chrome DevTools crashes after refresh when Loading Trace is enabled on Module Info tab

1 participant