Skip to content

router.push() issue when navigating from app router to pages #53776

@nicomatsmart

Description

@nicomatsmart

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: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.19.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: 8.6.11
    Relevant Packages:
      next: 13.4.14-canary.1
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3
    Next.js Config:
      output: N/A

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

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

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

https://github.com/nicomatsmart/next-router-push-issue

To Reproduce

  1. Visit https://next-router-push-issue.vercel.app/
  2. Click on the button
  3. You end up on the CatchAllPage, url says /about
  4. Refreshing should show the proper about page

Bug does not reproduce locally.

Describe the Bug

Using router.push() to navigate from app router to a pages page seems to get caught in the [...all] page in app router.

Bug might be related to both the middleware setup and the folder structure. Removing the [...all] page "solves" the issue. Worth repeating that the bug does not reproduce locally, only on Vercel.

Expected Behavior

Using a router.push() from the app router should show the page you wanted to navigate to (in this reproduction, the /about page).

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

NEXT-1537

Metadata

Metadata

Assignees

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