App Router routes intermittently return 404 after upgrading to Next.js 16.2.9
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/heroui-inc/next-app-template
To Reproduce
-
Upgrade an existing App Router application from a previous Next.js version to 16.2.9.
-
Start the application in production mode:
pnpm build
pnpm start
-
Navigate between routes using Link components and direct URL access.
-
Occasionally, valid routes return a 404 page even though the route exists and works correctly most of the time.
-
Refreshing the page or navigating again may temporarily resolve the issue.
The issue is intermittent and difficult to reproduce consistently.
Current vs. Expected behavior
Expected behavior
All App Router routes should be consistently resolved and rendered.
Actual behavior
Some existing routes intermittently return a 404 page. The routes are valid and function correctly most of the time. A refresh or subsequent navigation may make the route work again.
No route files were changed when the issue appeared. The problem started immediately after upgrading to Next.js 16.2.9.
Provide environment information
npx next info
Operating System:
Platform: linux
Arch: x64
Version: #22-Ubuntu SMP PREEMPT_DYNAMIC Mon May 25 15:54:34 UTC 2026
Available memory (MB): 15358
Available CPU cores: 4
Binaries:
Node: 20.20.0
npm: 10.8.2
Yarn: 1.22.22
pnpm: 10.30.0
Relevant Packages:
next: 16.2.9 // Latest available version is detected (16.2.9).
eslint-config-next: 15.5.9
react: 18.3.1
react-dom: 18.3.1
typescript: 5.6.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Route Handlers
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
- Using App Router.
- Using Next.js 16.2.9.
- The issue did not occur before upgrading.
- Routes are statically defined and exist in the application.
- The problem appears randomly and cannot be reproduced on demand.
- Deployment target: VPS with PM2.
- Build completes successfully without errors.
- No custom server is used.
- Refreshing the page often resolves the issue temporarily.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked next-app-template reproduction and run pnpm build followed by pnpm start. Compare route navigation and direct URL access before and after the upgrade to Next.js 16.2.9, including the Route Handlers area and the PM2 deployment context. Done means the existing App Router routes resolve consistently without intermittent 404 responses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, node.js, react
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100