Skip to content

Web: a chunk that fails after boot reloads the page in an endless loop #29304

Open

Description

@grodriguez-fr

What happened

On the web client served by t3 serve (0.1.7-nightly.20261102.4066, Chrome 152 on a managed Windows machine), opening any thread whose assistant messages contain a fenced code block reloads the whole page about every 2 seconds, with no end. Settings → Appearance does the same.

The same threads open fine on a phone and in a fresh Chromium on the server host. Something on that machine blocks one of the highlighter chunks (highlights-*.js or one of its dependencies). I couldn't capture the exact console error: the page reloads before it can be read, and the client traces are lost with it.

To reproduce without that machine: make any chunk loaded after boot fail on every request (for example block /assets/highlights-*.js in DevTools), then open a thread with a code block.

Why it loops

main.tsx reloads once on vite:preloadError through reloadOnceForChunkLoadError(), guarded by t3code:chunk-load-reloaded in sessionStorage. But startup calls clearChunkReloadGuard() after every boot where no chunk failed during startup. The highlighter is loaded lazily after boot, so each cycle is:

  1. boot succeeds, the guard is cleared;
  2. the code block renders and the highlighter chunk fails;
  3. the guard is empty, so the page reloads.

In the server trace, the thread's document was requested 8 times in about 10 s, each time about 1 s after /api/orchestration/threads/:id/bounded returned 200.

Without the reload, the failure would be harmless: the code block's error boundary in ChatMarkdown already falls back to a plain <pre>.

Workaround

Patching the built main-*.js so the guard expires after a few minutes instead of being cleared at boot stops the loop. After a hard refresh, the page reloads at most once and code blocks render without highlighting.

Related: #26437 and #26451 handle a failure of the main chunk during boot. #26451 keeps clearing the guard at boot, so it doesn't cover this case.

Activity

  1. added a commit that references this issue on Nov 2, 2026
    7c1207e
  2. added a commit that references this issue on Nov 12, 2026
    0e31f94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions