Skip to content

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

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

fix(devtools): guard invalid module info payloads#4787
dmchoi77 wants to merge 3 commits 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 2884962
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/6a1de37900ca8400080167b7
😎 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: 2884962

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

@ScriptedAlchemy ScriptedAlchemy requested a review from 2heal1 June 1, 2026 18:50
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 1, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@9ea767b

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@9ea767b

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@9ea767b

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@9ea767b

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@9ea767b

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@9ea767b

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@9ea767b

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@9ea767b

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@9ea767b

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@9ea767b

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@9ea767b

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@9ea767b

@module-federation/metro-plugin-rock

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rock@9ea767b

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@9ea767b

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@9ea767b

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@9ea767b

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@9ea767b

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@9ea767b

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@9ea767b

@module-federation/observability-plugin

pnpm add https://pkg.pr.new/@module-federation/observability-plugin@9ea767b

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@9ea767b

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@9ea767b

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@9ea767b

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@9ea767b

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@9ea767b

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@9ea767b

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@9ea767b

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@9ea767b

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@9ea767b

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@9ea767b

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@9ea767b

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@9ea767b

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@9ea767b

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@9ea767b

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@9ea767b

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@9ea767b

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@9ea767b

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@9ea767b

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@9ea767b

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@9ea767b

commit: 9ea767b

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Bundle Size Report

10 package(s) changed, 31 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/cli 26.3 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 665.6 kB +1.7 kB (+0.2%) 4.0 kB +5 B (+0.1%)
@module-federation/enhanced 808.0 kB no change 672 B no change
@module-federation/managers 69.8 kB no change 334 B no change
@module-federation/manifest 136.1 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/node 193.4 kB no change 217 B no change
@module-federation/storybook-addon 78.6 kB no change 100 B no change
@module-federation/utilities 110.6 kB no change 328 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -31 B (-1.3%) 2.3 kB -31 B (-1.3%)
@module-federation/core 1.1 kB -31 B (-2.8%) 1.0 kB -31 B (-2.9%)
@module-federation/devtools 30.3 kB +38 B (+0.1%) 30.3 kB +38 B (+0.1%)
@module-federation/enhanced 2.6 kB -44 B (-1.6%) 2.6 kB -44 B (-1.6%)
@module-federation/managers 2.4 kB -27 B (-1.1%) 2.4 kB -27 B (-1.1%)
@module-federation/manifest 6.1 kB -39 B (-0.6%) 6.1 kB -39 B (-0.6%)
@module-federation/metro-plugin-rnc-cli 411 B -25 B (-5.7%) 411 B -25 B (-5.7%)
@module-federation/node 9.2 kB -27 B (-0.3%) 9.2 kB -27 B (-0.3%)
@module-federation/storybook-addon 1.9 kB -25 B (-1.3%) 1.7 kB -24 B (-1.3%)
@module-federation/utilities 2.6 kB -31 B (-1.2%) 2.6 kB -31 B (-1.2%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 21.4 kB -13 B (-0.1%) 22.5 kB -9 B (-0.0%) +1.1 kB +4 B

Total dist (raw): 6.81 MB (+1.7 kB (+0.0%))
Total ESM gzip: 78.4 kB (+5 B (+0.0%))
Total web bundle (gzip): 206.6 kB (-242 B (-0.1%))
Total node bundle (gzip): 207.1 kB (-241 B (-0.1%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.8 kB (no change)
Tracked ./bundler node bundle (gzip): 4.8 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

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

2 participants