Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspense boundary behavior for transitions, initial load, and non suspending components. #53916

Closed
1 task done
ryanto opened this issue Aug 11, 2023 · 2 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. stale The issue has not seen recent activity.

Comments

@ryanto
Copy link

ryanto commented Aug 11, 2023

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 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.16.0
      npm: 9.5.1
      Yarn: N/A
      pnpm: 8.6.12
    Relevant Packages:
      next: 13.4.14-canary.2
      eslint-config-next: 13.4.13
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A

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

App Router, Routing (next/router, next/navigation, next/link)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/ryanto/next-13-suspense-transition

To Reproduce

The reproduction app contains a /route1 page that renders a server component in a suspense boundary. When visiting /route1 directly, the suspense boundary is not shown. However, when transitioning to /route1 (using <Link>), the suspense boundary gets rendered.

  1. Visit /route1 directly, reload a few times, no suspense boundary shown.
  2. Visit /, and click to the link to /route1. Suspense boundaries are shown.

Describe the Bug

It seems that a non-suspending component can trigger a suspense boundary during a transition, but not an initial render.

async function Page() {
  return (
    <Suspense fallback={<div>Shown for transitions, not initial load</div>}>
      <ServerComponent />
    </Suspense>
  );
}

async function ServerComponent() {
  return <div>I dont suspend</div>;
}

This behavior surprised me because I thought the boundary should not be shown when transitioning, but I might be misunderstanding something.

Also, the same behavior happens when awaiting an already resolved promise (suspend boundary is not shown on the initial render, but shown for a transition).

Expected Behavior

I'm not sure- but I was expecting the suspense boundaries to not be shown.

Which browser are you using? (if relevant)

Version 1.56.20 Chromium: 115.0.5790.171 (Official Build) (arm64)

How are you deploying your application? (if relevant)

No response

@ryanto ryanto added the bug Issue was opened via the bug report template. label Aug 11, 2023
@github-actions github-actions bot added the Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. label Aug 11, 2023
@ryanto ryanto changed the title Suspends boundary behavior for transitions, initial load, and non suspending components. Suspense boundary behavior for transitions, initial load, and non suspending components. Aug 11, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 18, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants