Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Edge runtime breaks revalidateTag on Vercel #57493

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

Open
1 task done
matthewwilson opened this issue Oct 26, 2023 · 3 comments
Open
1 task done

Edge runtime breaks revalidateTag on Vercel #57493

matthewwilson opened this issue Oct 26, 2023 · 3 comments
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router. stale The issue has not seen recent activity.

Comments

@matthewwilson
Copy link

Link to the code that reproduces this issue

https://github.com/matthewwilson/nextjs-boilerplate

To Reproduce

  1. Deploy the application to Vercel.

It consists of 3 pages

  • Home Page (static)
  • Child Page (static)
  • Edge Page (edge)

All pages make the same API call.

  1. During the build process observe the outputted timestamps returned from the API

A healthy output should look like this:

Got timestamp 1698315066.387
Got timestamp 1698315066.387
Got timestamp 1698315066.387
Got timestamp 1698315066.387

In this scenario everything will revalidate as expected by POSTing to the revalidate endpoint (/api/revalidate).

This is unhealthy output:

Got timestamp 1698315066.387
Got timestamp 1698315066.387
Got timestamp 1698315070.085
Got timestamp 1698315070.09

As soon as we start getting different timestamps (meaning that the API call isn't being memoized/cached) then revalidateTag will only revalidate one of the pages (home or child). No matter how many times revalidateTag is called, only one page will update.

Current vs. Expected behavior

I expect revalidateTag to work reliably when revalidating an API call that is used across multiple pages.

The sample app here is a simple reproduction, but we are seeing this same issue in production.

Removing the edge page fixes the issue. But this is not an option for us.

Everything works when running locally, but breaks on Vercel.

Verify canary release

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

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000
Binaries:
  Node: 18.18.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.8.0
Relevant Packages:
  next: 13.5.7-canary.35
  eslint-config-next: 13.5.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Data fetching (gS(S)P, getInitialProps)

Additional context

This issue has existed across multiple Next.js versions.

We have tested it from 13.4.13 to 13.5.7-canary.35

@matthewwilson matthewwilson added the bug Issue was opened via the bug report template. label Oct 26, 2023
@github-actions github-actions bot added the Pages Router Related to Pages Router. label Oct 26, 2023
@matthewwilson
Copy link
Author

matthewwilson commented Oct 26, 2023

Update, still broken in Next.js 14.0.1

@matthewwilson
Copy link
Author

This might be related - #55168

@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 Apr 29, 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. Pages Router Related to Pages Router. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants