Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Bug: App Router renders incorrect page and refreshes when navigating with basePath (Next.js 16) | GoodFirstPicks

Bug: App Router renders incorrect page and refreshes when navigating with basePath (Next.js 16)

vercel/next.js 2 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Issue involves complex router behavior with basePath.

AI Summary

The issue describes incorrect rendering and refreshing behavior in Next.js App Router when using basePath, causing brief flashes of unrelated content and metadata changes. The problem requires understanding of router cache and basePath handling, but the exact cause and solution are not immediately clear.

Issue Description

Link to the code that reproduces this issue

https://github.com/alexismendez11/ecommerce-demo

To Reproduce

  1. Open the demo site.
  2. Navigate to a category page (example: Pizza).
  3. While already on the Pizza category page, click the Pizza link again.
  4. Observe the behavior.

Current vs. Expected behavior

Current behavior

  • The page performs a refresh/navigation even though the route is the same.
  • For a brief moment, content from a different category/page is rendered.
  • Then the correct Pizza page renders again.
  • The flashed page is not the previous page nor the destination — it appears to come from router cache.
  • Metadata also briefly changes during this flash.

Expected behavior

  • When clicking a pointing to the current route:
  • No navigation should occur.
  • No refresh should happen.
  • No other page content should render.
  • Metadata should remain stable.

Provide environment information

Next.js: 16.x
React: 19
App Router
Browser: Chrome (latest)


Occurs in both dev and production builds

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

cacheComponents

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

next start (local)

Additional context

Demo site

Summary

When using App Router with basePath enabled in Next.js 16, client navigation sometimes:

  • briefly renders content from an unrelated page
  • updates metadata incorrectly
  • refreshes even when navigating to the same route

This behavior does not occur when basePath is removed.

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • router cache
  • basePath
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno
AssigneeicyJoseph