Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-opus-5· anthropicHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION A self-throwing global error component renders no last-resort UI If…

  1. User

    ISSUE DESCRIPTION

    A self-throwing global error component renders no last-resort UI

    If the global error component itself fails, return the built-in valid HTML fallback with the expected successful fallback status while preserving response headers and cookies. Local error boundaries and framework navigation/control-flow signals must retain their existing semantics, and the original boundary exception must not be exposed.

    Interface

    No new public interfaces are introduced.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /vinext, current file: none) bash-$

  2. Claude Assistant

    Now update renderAppPageErrorBoundary:

  3. Claude Assistant

    Now add the import:

  4. Claude Assistant

    Now run the repro again:

  5. Claude Assistant

    Summary of the change

    Problem: when app/global-error.tsx (or vinext's built-in default global error component) throws while rendering, the throw escaped the App Router render pipeline — the request ended in a bodyless/dev-overlay 500 with no UI at all.

    Fix:

    1. New module packages/vinext/src/server/app-global-error-fallback.ts

      • buildGlobalErrorFallbackResponse() — returns the built-in, valid last-resort HTML document (<!DOCTYPE html><html id="__next_error__">…, copy mirroring the built-in default global error UI) with the boundary's successful status (200), text/html, Vary parity, Cache-Control: no-store, and middleware response headers/Set-Cookie merged in. The original boundary exception is never put in the body.
      • isFrameworkControlFlowSignal() — recognises redirect()/notFound()/forbidden()/unauthorized() plus the CSR / dynamic-server / static-gen bailout digests.
    2. renderAppPageErrorBoundary() (app-page-boundary-render.ts) now awaits the boundary response only when the resolved boundary is the global error boundary; if that render fails it rethrows control-flow signals unchanged, logs the real error server-side, clears the request context and returns the fallback document. Local error.tsx boundaries keep their exact previous code path/semantics.

    Checklist

    • Reproduced the reported error — built a temp fixture (throwing global-error.tsx + throwing page): /boom returned 500 with Vite's error page and no last-resort UI, in both dev and production preview.
    • Confirmed the fix resolves it — same fixture now returns 200 with the built-in fallback document (exactly one <html>/<body>), no leak of "page blew up" / "global error boundary exploded", in dev and prod preview. Also verified at unit level through renderAppPageErrorBoundary.
    • Edge cases considered/verified — middleware headers (x-mw) and cookies (set-cookie: mw-cookie) preserved; local error.tsx boundary still renders its own UI with 200 (no fallback); redirect() thrown from the global error component behaves exactly as before (signal rethrown, verified against the stashed baseline); async server-component global error also produces the fallback; RSC (.rsc) requests keep their existing flight-payload behavior; request context is cleared on the bail-out path; knip/unused-export, fmt, lint, type-check and vinext#build all pass.
    • Ran existing tests — unit project (5867 passed; only pre-existing tests/oxlint-prefer-shared-utils.test.ts failures, which also fail on the untouched baseline), all tests/nextjs-compat/** (26 files), app-router-dev-server, entry-templates, features, app-router-production-server, plus the boundary/fallback unit suites. No tests were added or modified (all temp fixtures/scripts removed).

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.