Skip to content

fix(app): bump vite to 8.3.5 to fix blank site (runtime chunk cycle) - #12235

Merged
MarkusNeusinger merged 1 commit into
mainfrom
ccr-97a3853d-oq5zjb
Oct 22, 2026
Merged

MarkusNeusinger merged 1 commit into
mainfrom
ccr-97a3853d-oq5zjb

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

  • Production outage: since deps(npm): Bump vite from 8.0.16 to 8.1.6 in /app #12225 (Vite 8.0.16 → 8.1.6), every page on anyplot.ai renders blank. Rolldown 1.1.5 places its CJS-interop runtime helper in the app's theme chunk, which imports mui, while mui imports the helper back. The chunk cycle leaves the helper uninitialized: TypeError: t is not a function at assets/mui-*.js:1.
  • Bumps vite to 8.3.5 (Rolldown 1.2.15), which emits the helper as a separate rolldown-runtime chunk with no imports, so the cycle is gone. manualChunks and native codeSplitting.groups cannot steer the runtime module (it is never offered to group matchers), so a config-only fix wasn't possible on 8.1.6.
  • Deduplicates yarn.lock so vitest's vite@^6 || ^7 || ^8 range resolves to the same 8.3.5 instead of keeping 8.1.6.

Test plan

  • Reproduced the crash against prod with headless Chromium (/, /scatter-basic, /gain-curve all blank with the page error above).
  • Reproduced locally with vite build on 8.1.6: mui → theme → mui import cycle in dist/assets.
  • vite build on 8.3.5: mui and vendor import only rolldown-runtime, no cycle; vite preview of /gain-curve boots the app with no page error.
  • tsc --noEmit passes.
  • vitest run: 1166/1168 pass; the 2 failures (fileText.test.ts, windows-1252 decoding) fail identically on main in this container (Node 22.22.0, below the jsdom engine range), so they are environmental, not from this change.

Checklist

  • changelog.d/vite-runtime-chunk-cycle.md added
  • Related documentation updated — not needed, no behavior change beyond the fix

Generated by Claude Code

Vite 8.1.6 (Rolldown 1.1.5) placed Rolldown's CJS-interop runtime in the
app's theme chunk, which imports mui while mui imports the runtime back.
The cycle left the helper uninitialized and every page crashed with
"t is not a function". Vite 8.3.5 (Rolldown 1.2.15) emits the runtime
as its own chunk. The lockfile is deduplicated so vitest shares it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gWuDKsb8J8uqXsHdmhHqs
Copilot AI balanced review requested due to automatic review settings October 22, 2026 18:35
@MarkusNeusinger
MarkusNeusinger enabled auto-merge (squash) October 22, 2026 18:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The dependency changes are internally consistent, the reported build and browser checks support the fix, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Updates the frontend build dependencies to fix the blank-page regression introduced by #12225, without changing application code or chunk configuration.

Changes:

  • Bumps Vite from 8.1.6 to 8.3.5, bringing in Rolldown 1.2.15 to eliminate the runtime-helper chunk cycle.
  • Keeps the app and Vitest on the same locked Vite version and updates related dependencies.
  • Adds a changelog entry explaining the outage and fix.
File Description
changelog.d/​vite-runtime-chunk-cycle.md Documents the blank-page regression and its resolution.
app/​yarn.lock Locks the updated Vite, Rolldown, and related dependencies.
app/​package.json Pins Vite to 8.3.5.

Review effort: Balanced

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarkusNeusinger
MarkusNeusinger merged commit 5ada7f6 into main Oct 22, 2026
16 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the ccr-97a3853d-oq5zjb branch October 22, 2026 18:40
MarkusNeusinger added a commit that referenced this pull request Oct 22, 2026
…merges (#12236)

## Summary
- On 2026-10-22 vite 8.1.6 (#12225) passed every PR check and its
deploy, and left every page on anyplot.ai blank for about 45 minutes
(Rolldown chunk cycle, `TypeError: t is not a function` at module load;
fixed by #12235). Nothing in CI or the post-merge routine ran the
bundle.
- New `scripts/site-smoke.mjs`: loads `/`, `/plots` and `/scatter-basic`
in headless Chromium and fails on a status other than 200, an uncaught
page error, or an empty `#root`; checks `api.anyplot.ai/health`. It
never downloads a browser (CHROME_PATH, the cloud container's Chromium,
or the Playwright MCP's).
- **Before the merge:** the `app-image` job of `ci-image.yml` runs it
against the built gate-off container with the runner's Google Chrome,
whenever the container's inputs change (`package.json`, `yarn.lock`,
`vite.config.ts`, ...), which is every frontend dependency bump.
- **After the merge:** a new `CLAUDE.md` rule (owner request,
2026-10-22) with the recipe in `/open-pr` §4 and the Dependabot batch
command: after every merge, once its deploys finish, run the smoke
against production; a FAIL is an incident and stops further merges. The
Dependabot command also merges lock-file PRs one at a time and smokes
after each `app/` bump. The incident narrative is in
`.claude/guardrails.md`.

## Plan
N/A. The owner asked on 2026-10-22, after the outage, for a rule or
skill so a blank site never goes unnoticed again.

## Test plan
- [x] Local app image built like CI
(`VITE_API_URL=https://api.anyplot.ai`), gate-off container on :8081,
`SITE=http://localhost:8081 API=none MIN_TEXT=50 node
scripts/site-smoke.mjs /`: OK (`text=2736`, one CORS console error
reported as a warning)
- [x] Same against an image built from 20c1457 (vite 8.1.6, the broken
state): `FAIL ... text=0 ... pageerror: t is not a function`, exit 1
- [x] Against production: all four checks OK
- [x] `uv run pytest tests/unit/workflows` (766 passed), `uv run ruff
check .`, changelog check
- [ ] This PR's own `Build app image and smoke the origin gate` run
exercises the new step on the runner (ci-image.yml changes trigger the
job)
- No live verification loop exists for `.github/workflows/` beyond this
PR's own run; the CLAUDE.md rule has no twin in
`.github/copilot-instructions.md`, which does not carry the merge
routine.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants