next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Vercel + pages router + basePath + middleware - Full roundtrip when client navigating to index page

Open jpb06 opened this issue 1 year ago • 3 comments

Link to the code that reproduces this issue

https://github.com/jpb06/next-repro-404-index.json

To Reproduce

The issue only happens while deployed on Vercel.

1: Head to repro sub page. 2: Click on the Home link.

Current vs. Expected behavior

Current behavior

  • We are doing a client navigation, but a full roundtrip is occurring when navigating from /yolo to /.
  • We get a 404 on theindex.json file (prefetch), even though that file exists.

Expected behavior

  • Client navigation should not cause a full roundtrip.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: 1.22.21
  pnpm: 9.1.3
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: 14.2.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

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

Middleware, Navigation, Pages Router

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

Vercel (Deployed)

Additional context

No response

jpb06 avatar May 29 '24 15:05 jpb06

Potential duplicate of 65745

jpb06 avatar May 29 '24 15:05 jpb06

I found bug about Link with basePath #66660 maybe this is related

hscstudio avatar Jun 08 '24 04:06 hscstudio

This issue has been automatically marked as stale due to inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

nextjs-bot avatar Dec 05 '25 23:12 nextjs-bot

This issue has been automatically closed due to inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

nextjs-bot avatar Dec 12 '25 23:12 nextjs-bot