[PR #252] [MERGED] fix: apps with both app + pages router returning 404s #419

Closed
opened 2026-05-06 12:39:43 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/252
Author: @james-elicx
Created: 3/4/2026
Status: Merged
Merged: 3/5/2026
Merged by: @southpolesteve

Base: mainHead: james/app-pages-fix


📝 Commits (4)

  • f65432e fix: apps with both app + pages router returning 404s
  • 45aa6a8 apply same fix for api routes
  • cf98cbd test for pages dir route
  • 584704b always filter x-middleware headers, and preserve others on redirect

📊 Changes

4 files changed (+56 additions, -12 deletions)

View changed files

📝 packages/vinext/src/index.ts (+23 -5)
📝 packages/vinext/src/server/middleware.ts (+14 -7)
📝 tests/app-router.test.ts (+12 -0)
tests/fixtures/app-basic/pages/old-school.tsx (+7 -0)

📄 Description

If an app has both an app directory and a pages directory, all its app directory routes return 404s.

Regression test is achieved through simply having a pages directory route live in the app directory fixture. Without this patch, you then get 404s.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/252 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/5/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `james/app-pages-fix` --- ### 📝 Commits (4) - [`f65432e`](https://github.com/cloudflare/vinext/commit/f65432ecce62236dd0427fa17a23d320d15dbfe9) fix: apps with both app + pages router returning 404s - [`45aa6a8`](https://github.com/cloudflare/vinext/commit/45aa6a82b430568461a21af671d381aced63ea5a) apply same fix for api routes - [`cf98cbd`](https://github.com/cloudflare/vinext/commit/cf98cbd2e64270b25bf16fa8abfcf3d9b733a17e) test for pages dir route - [`584704b`](https://github.com/cloudflare/vinext/commit/584704b8a0d975ed66768cca30508891204a0ff4) always filter x-middleware headers, and preserve others on redirect ### 📊 Changes **4 files changed** (+56 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/index.ts` (+23 -5) 📝 `packages/vinext/src/server/middleware.ts` (+14 -7) 📝 `tests/app-router.test.ts` (+12 -0) ➕ `tests/fixtures/app-basic/pages/old-school.tsx` (+7 -0) </details> ### 📄 Description If an app has both an app directory and a pages directory, all its app directory routes return 404s. Regression test is achieved through simply having a pages directory route live in the app directory fixture. Without this patch, you then get 404s. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:43 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#419
No description provided.