-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
Server component won't re-render when deleting all search params #64978
Comments
Our ecommerce collection pages are often accessed with pre-populated query parameters, and this bug is preventing to go back to the unfiltered version of each collection. As mentioned by @georgesofianosgr, when landing on a URL with query parameters and then navigating to the same URL without parameters, the RSC fails to execute properly. You can view a video demonstrating both of these issues here: Screen.Recording.2024-05-16.at.10.14.15.movShould you require it for further analysis, here's the references to the demo of the above video: |
@georgesofianosgr @federicobadini hey guys, did you find any solution? i found myself in the same scenario - i followed next's guide to search and pagination (https://nextjs.org/learn/dashboard-app/adding-search-and-pagination) exactly but i still get this issue. |
@mortz123 I personally rolled back to 14.1.4 which does not suffer from this issue. |
It can be checked on v14.2.3, too. In my case,
So, I think that nextjs does not distinguish "first visited search param state" and "no search param state". |
Hey @federicobadini , how did you roll back? i tried to install next@14.1.4 but when i start my app, it seems broken like no styles are applying |
Have you ensured that all references to the previous |
Hi - thanks for the report. I verified that this bug has been fixed on canary as of this PR which landed in v14.2.0-canary.58. This should be coming to a stable release soon. In the meantime, please let us know if you are still seeing the unexpected behavior when testing it on the latest canary. |
glad to hear! thank you :) which version it should be when releasing? (14.2.4?) |
14.2.4 has already been released, so it'll be in 14.2.5 |
ohh i see, thank you! :) |
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/elastic-sun-s3d7mt
To Reproduce
The page wont re-render.
Current vs. Expected behavior
In nextjs 14.1.1 if I remove all the search params the page will re-render.
In nextjs 14.2.2 and next@14.3.0-canary.21 the page won't re-render after removing the search params.
That only happens if you visit the page with search params from the start.
Our current workaround is to after pushing the page when there are not search params is to do router.refresh().
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 4102 Available CPU cores: 2 Binaries: Node: 20.9.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: 8.10.2 Relevant Packages: next: 14.3.0-canary.21 // Latest available version is detected (14.3.0-canary.21). eslint-config-next: 14.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: