vercel / vercel/next.js

App Router routes intermittently return 404 after upgrading to Next.js 16.2.9

Open
#94,802 15 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Route Handlers
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
  1. Upgrade an existing App Router application from a previous Next.js version to 16.2.9.

  2. Start the application in production mode:

pnpm build
pnpm start
  1. Navigate between routes using Link components and direct URL access.

  2. Occasionally, valid routes return a 404 page even though the route exists and works correctly most of the time.

  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.