vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.47k stars 27.04k forks source link

Bug When Using Browser Back with Intercepting Routes #62434

Open yacchi1123 opened 9 months ago

yacchi1123 commented 9 months ago

Link to the code that reproduces this issue

https://github.com/yacchi1123/next-intercept-route-bug-reproduce

To Reproduce

  1. Access the following URL: https://next-intercept-route-bug-reproduce.vercel.app/
  2. Navigate to the page that triggers the Intercepting Route.
  3. Perform a Submit using Server Action, and within the Server Action, execute redirect and revalidate.
  4. Click the browser back button.
  5. "Loading..." remains displayed.

https://github.com/vercel/next.js/assets/43910343/71fbbea9-6810-4387-ab4c-d346e96f7a9e

Current vs. Expected behavior

Current Behavior: When using Intercepting Route and performing a redirect and revalidate with a Server Action, doing a browser back results in a perpetual loading state.

Expected Behavior: The loading state is resolved, and the page of Intercepting Route is displayed.

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:10 PST 2023; root:xnu-10002.61.3~2/RELEASE_X86_64
Binaries:
  Node: 18.17.1
  npm: 9.0.0
  Yarn: 1.22.19
  pnpm: 8.15.1
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.2
Next.js Config:
  output: N/A

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

App Router, Routing (next/router, next/navigation, next/link)

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

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

No response

xvvvyz commented 9 months ago

Duplicate of https://github.com/vercel/next.js/issues/61336 I think.

yacchi1123 commented 9 months ago

@xvvvyz Thank you for reply. I will try to check again once the issue mentioned above has been resolved.

yacchi1123 commented 8 months ago

Issue #61336 seems to have been closed, but the problem still occurs even after updating to 14.2.0-canary.13.

0sama commented 6 months ago

+1

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!