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

Client-side navigation not working for SSG pages using generateStaticParams out to other pages (SSG/SSR/etc). #54043

Closed
1 task done
WilsonPhooYK opened this issue Aug 15, 2023 · 2 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@WilsonPhooYK
Copy link

Verify canary release

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

Provide environment information

Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Pro
    Binaries:
      Node: 18.17.0
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.16-canary.1
      eslint-config-next: 13.4.16
      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

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

https://github.com/WilsonPhooYK/nextjs-routing

To Reproduce

  1. Go to the deployed website at https://nextjs-routing-nu.vercel.app/en
  2. Open the developer console.
  3. Perform client-side navigation by pressing one of the page hyperlinks.
  4. Watch the console for multiple SHOULD ONLY MOUNT 1 TIME! logs as it does a full reload instead of client-side rendering.

Describe the Bug

The setup is simple. I have a layout under a dynamic route. Inside of it is a memoized client component that does not take in props.
image
image

The pages and rendered using generateStaticParams to parse the language for the page to make is SSG.
image

However, running client-side rendering on these pages forces a full reload, as seen from the client side, which keeps on remounting.
image

This effect is devastating in real projects as all my global states and variables are destroyed when still navigating under the same layout parent.

This happens on a production build.

Expected Behavior

Using client-side navigation, Link from next/link or router.push from next/navigation, should never force a full reload on the Layout if the target path is a local path even when they are SSG pages using generateStaticParams.

Which browser are you using? (if relevant)

Chrome Version 115.0.5790.171 (Official Build) (64-bit)

How are you deploying your application? (if relevant)

Vercel

@WilsonPhooYK WilsonPhooYK added the bug Issue was opened via the bug report template. label Aug 15, 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. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants