Skip to content

Parallel routes breaks the browser back button, and it happens even on https://nextgram.vercel.app/ #64676

Closed
@emp

Description

@emp

Link to the code that reproduces this issue

https://github.com/vercel/nextgram

To Reproduce

STEPS (the parallel routing example under the vercel github org nextgram is being sent as how to reproduce the issue as happens there as well)

  1. Go to https://nextgram.vercel.app/
  2. Click a photo to open the modal (such as /photos/1)
  3. Press refresh (this shows the in-page render of the /photos/1)
  4. Press back (this shows the homepage again)
  5. Press refresh again
  6. Press forward (the url changes to /photos/1 but no content changes and after a few seconds you get the client-side app crash)

Current vs. Expected behavior

I was experiencing this strange behavior in the parallel routes and I assumed it was due to my app being able to jump from slot route to route without "exiting" the route (such as closing a modal and going back to the initiator page) but I managed to reproduce the issue even on simple modal examples of the feature.

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_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 18.19.1
  npm: 10.2.4
  Yarn: 1.22.21
  pnpm: 8.15.7
Relevant Packages:
  next: 14.2.1 // Latest available version is detected (14.2.1).
  eslint-config-next: 14.2.1
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: N/A

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

Parallel & Intercepting Routes

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

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

Additional context

No response

NEXT-3146

Metadata

Metadata

Assignees

No one assigned

    Labels

    Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions