Skip to content

[next/router on iOS 17+ and Chrome 127+] router.replace while clicking on a next link and going to the new page will make the user skip the previous page on back #82522

@aciulpan

Description

@aciulpan

Link to the code that reproduces this issue

https://github.com/aciulpan/nextjs-router-replace-issue

To Reproduce

Requirements: You must be on iOS 17+ and Chrome 127+ in order to see the issue.

  1. Clone the repo
  2. npm run dev
  3. Start an ngrok tunnel or something so that you can access the page on a mobile phone (iOS 17+ and Chrome 127+), or simply deploy the app.
  4. Starting in the homepage, click on "PLP" page
  5. While in the "PLP" page, click on the "PDP" page. This will call a router.replace and put a timestamp in the query params
  6. Click back and see that you get sent back to the homepage instead of going back to the "PLP" page.

Current vs. Expected behavior

I expected that you be sent back to the previous page, but instead it skipped the "PLP" page entirely which means that the page was deleted from history.
This does not happen on other browsers and devices as far as I can see.

Provide environment information

Note that this is not relevant to the issue since it depends on a combination of iOS and Chrome versions.

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 24.0.1
  npm: 11.3.0
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.4.6 // Latest available version is detected (15.4.6).
  eslint-config-next: 15.4.6
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

Linking and Navigating

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

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

Additional context

My original app runs on next 13 and I created a small app (that is linked here) in order to see if the upgrade to next 15 would fix my issue, but it does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions