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
Page was incorrectly cached when Route parameter contains :
#38581
Comments
Going to attempt to fix this. I think I also narrowed down the regression to #37646, which has related code to what you pointed out. |
@visnup If it helps, we're experiencing this issue as well. On SSR pages and when the |
Yeah, I have a PR for a fix in #39568 (one line?). I don't know how to get more eyes on that. I guess the more upvotes and activity we can get on this issue, the better? @GioLogist Have you found any good workarounds in the meantime? We're experiencing the exact same issue since we use |
patch-package is a good way to fix your project before next.js merging the PR. |
Fixes #38581 <!-- Thanks for opening a PR! Your contribution is much appreciated. In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change that you're making: --> ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by: JJ Kasper <jj@jjsweb.site>
…39568) Fixes vercel#38581 <!-- Thanks for opening a PR! Your contribution is much appreciated. In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change that you're making: --> ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by: JJ Kasper <jj@jjsweb.site>
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Google Chrome Version 103.0.5060.114 (Official Build) (64-bit)
How are you deploying your application? (if relevant)
Describe the Bug
When the Route parameter contains the
:
character, page uses getServerSideProps will be incorrectly cached in the browser by next.js.This is because an encoding error in
cacheKey
causing next.js unable todelete _this.sdc[cacheKey]
(Server Data Cache)next.js/packages/next/shared/lib/router/router.ts
Lines 1841 to 1847 in 13557ea
Expected Behavior
Even if Router parameter contains the
:
character, page uses getServerSideProps should not be cached.Link to reproduction
https://next-cache-test-fawn.vercel.app/
To Reproduce
Click the second & fourth link repeatedly, the server generated content will not change because it's cached in browser.
This is only reproducible in
production
build.I've disabled the minimize (
config.optimization.minimize = false
) to make it easy to debug.Demo: https://next-cache-test-fawn.vercel.app/
Demo source: Coxxs/next-cache-test@fe30c1a
The text was updated successfully, but these errors were encountered: