[docs] Fix broken visual-regression build (missing styled-components dependency) - #23562
Draft
github-actions[bot] wants to merge 1 commit into
Draft
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
Janpot
requested changes
Sep 9, 2026
Janpot
left a comment
Member
There was a problem hiding this comment.
Please ignore, I'm working on this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's broken
The
test_regressionsCI job builds the docs app in production mode before running visual-regression tests. That build has been failing outright with: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-docsdeclaresstyled-componentsas an optional peer dependency (peerDependenciesMeta: { "styled-components": { optional: true } }).docs/package.jsonalready lists every other peer dependency of@mui/internal-core-docsas a real, direct dependency (@emotion/*,@mui/material,@mui/system,react-runner, etc.) — exceptstyled-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-componentsinstead 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'srtlBundle.jsdoesexport { StyleSheetManager } from "styled-components", which fails against that empty stub.Fix
Add
styled-componentsas an explicit dependency indocs/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
pnpm install—pnpm-lock.yamlpicks upstyled-components@6.4.4as a direct dependency ofdocs(previously only present as anoptional: truetransitive resolution).pnpm run buildintest/regressions(the exact command the failing CI step runs) — it now completes successfully with noMISSING_EXPORTerror (previously failed every time).Not verified: the full
test_regressionsPlaywright 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.