Issue involves complex router behavior with basePath.
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.
https://github.com/alexismendez11/ecommerce-demo
Next.js: 16.x
React: 19
App Router
Browser: Chrome (latest)
Occurs in both dev and production builds
cacheComponents
next start (local)
Summary
When using App Router with basePath enabled in Next.js 16, client navigation sometimes:
This behavior does not occur when basePath is removed.
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!