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

On-demand revalidation inconsistent on App router vs. Pages when deploying to Vercel #53187

Closed
1 task done
Windsorborn opened this issue Jul 26, 2023 · 1 comment · Fixed by #53595
Closed
1 task done
Labels
bug Issue was opened via the bug report template. locked

Comments

@Windsorborn
Copy link

Verify canary release

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

Provide environment information

Operating 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

Binaries:
      Node: 18.16.1
      npm: 9.5.1
      Yarn: N/A
      pnpm: N/A

Relevant Packages:
      next: 13.4.12
      eslint-config-next: 13.4.12
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6

Next.js Config:
      output: N/A

Note: the reported issue relates to the Vercel environments only.

Which area(s) of Next.js are affected? (leave empty if unsure)

App Router

Link to the code that reproduces this issue or a replay of the bug

https://github.com/Windsorborn/next-revalidation-test-app

To Reproduce

  1. Clone the provided repository (https://github.com/Windsorborn/next-revalidation-test-app)
  2. Setup a project on Vercel and deploy the code
  3. View the home page and take note of the timestamp
  4. Hit the revalidation endpoint - /api/revalidate?tag=timezone&secret=O5mc4yJp8d6j
  5. Refresh the page

Describe the Bug

On first view of the page after hitting the revalidation endpoint, the page requires two refreshes to see the fresh data. This is not consistent with the behaviour of the Pages configuration which only requires one refresh or visit.

See video: https://imgur.com/T4xduRU

Expected Behavior

The expected behaviour is to replicate the res.revalidate function within the Pages configuration where one refresh shows the fresh data.

To reproduce this:

  1. Clone the following repository - https://github.com/Windsorborn/next-revalidation-test-pages
  2. Setup a project on Vercel and deploy the code
  3. View the home page and take note of the timestamp
  4. Hit the revalidation endpoint - /api/revalidate?secret=O5mc4yJp8d6j
  5. Refresh the page or soft-navigate from Another Page (/another-page)

The timestamp reflects the updated data

See video: https://imgur.com/NqxN44T

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

@Windsorborn Windsorborn added the bug Issue was opened via the bug report template. label Jul 26, 2023
@kodiakhq kodiakhq bot closed this as completed in #53595 Aug 4, 2023
kodiakhq bot pushed a commit that referenced this issue Aug 4, 2023
This ensures `revalidateTag()` doesn't cause an async/background revalidation unexpectedly and instead does a blocking revalidate so fresh data is shown right away when a path is using ISR. 

Test deployment with patch can be seen here: https://next-revalidation-test-47rqf8q5s-vtest314-ijjk-testing.vercel.app/

Fixes: #53187
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant