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

getBlogMetadataById is called twice when client side navigating to /blog/:slug pages #197

Open
mwskwong opened this issue Jan 8, 2024 · 2 comments
Assignees
Labels
bug Something isn't working priority: low

Comments

@mwskwong
Copy link
Owner

mwskwong commented Jan 8, 2024

  • This issue only happens on /blog/:slug page during client-side navigation.
  • This issue is not reproducible when fully refreshing (F5 or Ctrl + F5) /blog/:slug, in which the query is only called once as expected.
  • This issue is not reproducible in /guestbook, which also makes use of PPR.
@mwskwong mwskwong added the bug Something isn't working label Jan 8, 2024
@mwskwong mwskwong self-assigned this Jan 8, 2024
@mwskwong
Copy link
Owner Author

mwskwong commented Jan 9, 2024

Would it because the fallback component and the delayed component are within the same file?

@mwskwong
Copy link
Owner Author

mwskwong commented Mar 9, 2024

Seems to be caused by Next.js fetching 2 separate RSC payloads on client-side routing to blog page and each of them triggers the query once respectively.

Using React.cache will not work because those are two HTTP requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: low
Projects
None yet
Development

No branches or pull requests

1 participant