-
Notifications
You must be signed in to change notification settings - Fork 130
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
[🐛 Bug]: revalidateTag
not working as expected
#451
Comments
Hello, thank you for raising this issue. Unfortunately, I'm not having much luck trying to reproduce it - would it be at all possible for you to share a reproduction, or further steps that can be used to try and reproduce this issue? You can see a test app that I've deployed using Next.js v13.4.19 at https://next-cache-demo.eli.cx/.
I would also note that this isn't necessarily always the case - I've noticed inconsistencies/bugs between |
@james-elicx thank you for responding. Just to confirm that I get it right, are you saying that if you go to this URL and hit the Here's the Next.js page that handles that route and here's the server action that is calling
Do you happen to be able to share the source code for that example so that I can compare? |
Just tried it that way in local, |
No, sorry for the confusion, I meant that I wasn't having any luck trying to reproduce it in another project. It does happen when I visit your site.
Ah, I see now. Thank you for the link to the repro. I believe this is because URLSearchParams appears to encode URI parameters, so when it reaches Next.js, the param has I noticed this in one of my projects recently too. I haven't looked into it enough to see if there is a way to work around this in next-on-pages without breaking the intentional use of encoded strings, but you could use
https://github.com/james-elicx/next-geolocation-pages |
Wow, great find @james-elicx! I added a decode for params and now it's working like charm! :) Not entirely sure why Thank you for your help and for sharing that repo! |
Glad to hear! Yeah, you can open another issue about the inconsistency there if you'd like, but I have a feeling that it's going to be because workerd is based on web standards, whereas |
Hello! I have been debugging Internal cache handling behavior of Next.js seems to be changed starting from version 13.5 and above. If I put a log Here below is the result from Nextjs version
Result from Nextjs version
There is no longer If I clone and build the test project locally with Next 13.5 or 14+, and simulate environment using Wrangler, I can reproduce |
looks like the type signature changed in next.js :( would you be able to open a new issue for this @susemeee? i recall on your other issue you ticked the box that you'd be interested in helping fix the bug. would you like to give this issue a go? if not, just lmk and i'll be happy to look into a fix |
Sure! Let's talk on in #556 |
next-on-pages environment related information
System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 16 GB
Shell: /bin/zsh
Binaries:
Node: 18.14.0
Bun: N/A
pnpm: N/A
Yarn: 1.22.19
npm: 9.3.1
Package Manager Used: npm
Relevant Packages:
@cloudflare/next-on-pages: 1.6.0
vercel: N/A
next: 13.4.19
Description
Based on this comment and this PR, it looks like support for
revalidateTag
was introduced but when I'm trying to use it on a demo project, it's simply not working. The POST request is being triggered as expected by Next.js but there seems to be no results. However,revalidatePath
does seem to work as expected.Here's an URL where you can test this out, the first two buttons use
revalidateTag
under the hood only to revalidate the current page, and the third button just revalidates everything that is under the/time/
URL.I'm looking to know if 1.6.0 only introduced support for
revalidatePath
but not forrevalidateTag
, or if it's a bug andrevalidateTag
should also work. Unfortunately, for my use case I need granular revalidation and that can only be achieved withrevalidateTag
currently on Next.js 13.Reproduction
No response
Pages Deployment Method
Pages CI (GitHub/GitLab integration)
Pages Deployment ID
ab81c1b6-3b35-4055-8d61-3884b69e8219
Additional Information
npm run dev
so it's definitely something CF related, not a misuse of Next.js.Would you like to help?
The text was updated successfully, but these errors were encountered: