Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Page crashes and "Error: Connection closed." appears #49205

@hansottowirtz

Description

@hansottowirtz

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.15.0
      npm: 9.5.0
      Yarn: 3.5.0
      pnpm: 7.27.0
    Relevant packages:
      next: 13.3.1-canary.4
      eslint-config-next: 13.2.4
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

/

To Reproduce

Navigate to a page

Describe the Bug

It's very rare, but we sometimes get "Error: Connection closed." errors that crash the whole page, on navigation to a page. "Application error: a client-side exception has occurred" appears. It seems to happen when traffic to our website is low. Our website is hosted on Vercel and we're using app dir.

Screenshot 2023-05-04 at 14 42 28

It originates from either here:
https://github.com/facebook/react/blob/aef7ce5547c9489dc48e31f69b002cd17206e0cb/packages/react-server/src/ReactFlightReplyServer.js#L579
or here:
https://github.com/facebook/react/blob/aef7ce5547c9489dc48e31f69b002cd17206e0cb/packages/react-server/src/ReactFlightReplyServer.js#L579

Expected Behavior

This shouldn't happen, or at least show the error.tsx error boundary.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.please add a complete reproductionPlease add a complete reproduction.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions