Skip to content

[docs] Fix broken visual-regression build (missing styled-components dependency) - #23562

Draft
github-actions[bot] wants to merge 1 commit into
masterfrom
ci-flake-fix/20260909-123018
Draft

github-actions[bot] wants to merge 1 commit into
masterfrom
ci-flake-fix/20260909-123018

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What's broken

The test_regressions CI job builds the docs app in production mode before running visual-regression tests. That build has been failing outright with:

[MISSING_EXPORT] "StyleSheetManager" is not exported by "__vite-optional-peer-dep:styled-components:@mui/internal-core-docs"

This isn't test flakiness — it's a deterministic build failure, so it fails on essentially every commit that reaches this job, regardless of what the commit actually changes. Seen at least twice in the last 17 failed CI runs, on two unrelated dependency-bump commits:

Root cause

@mui/internal-core-docs declares styled-components as an optional peer dependency (peerDependenciesMeta: { "styled-components": { optional: true } }). docs/package.json already lists every other peer dependency of @mui/internal-core-docs as a real, direct dependency (@emotion/*, @mui/material, @mui/system, react-runner, etc.) — except styled-components, which was missing.

Because it's never a direct/hoisted dependency anywhere in the workspace, Vite/Rolldown's optional-peer-dependency resolution falls back to a virtual empty stub module for styled-components instead of the real package that's actually installed (it only exists nested under @mui/internal-core-docs's own peer resolution). @mui/internal-core-docs's rtlBundle.js does export { StyleSheetManager } from "styled-components", which fails against that empty stub.

Fix

Add styled-components as an explicit dependency in docs/package.json, matching the existing pattern for the rest of @mui/internal-core-docs's peer dependencies. This makes pnpm hoist a real, resolvable copy of the package so Vite picks up the real module instead of the stub.

Verified

  • Ran pnpm installpnpm-lock.yaml picks up styled-components@6.4.4 as a direct dependency of docs (previously only present as an optional: true transitive resolution).
  • Ran pnpm run build in test/regressions (the exact command the failing CI step runs) — it now completes successfully with no MISSING_EXPORT error (previously failed every time).

Not verified: the full test_regressions Playwright test suite (screenshot comparisons), since that requires a running server and is unrelated to this build-time failure.


Opened by a sandboxed agent. Unverified beyond any local check noted above; CI on this PR is the real test.

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23562--material-ui-x.netlify.app/
QR code for https://deploy-preview-23562--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 0B(0.00%) 0B(0.00%)
@mui/x-scheduler-premium 0B(0.00%) 0B(0.00%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Janpot Janpot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please ignore, I'm working on this

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.

1 participant