Skip to content

NextJS error page not shown if query fails and another query succeeds on initial page load #65

@fdev

Description

@fdev

Problem
When a page contains a useSuspenseQuery and that query fails, the nearest error.tsx is rendered. However, when another useSuspenseQuery is in the same page that does succeed, the error page is no longer rendered and the suspense fallback is rendered indefinitely.

How to reproduce
I have set up a CodeSandbox to demonstrate this specific issue.

  1. Open the root page.
  2. Click on Apollo with working query + broken query.
  3. The error page will render.
  4. Do a hard reload of the page.
  5. Notice the error page doesn't render and the suspense fallback is rendered indefinitely.

Video of issue occurring in CodeSandbox

error.page.mp4

CodeSandbox
https://codesandbox.io/p/sandbox/confident-glade-rg9fzx

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