mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #235] [MERGED] fix: new routes fail on running dev server #408
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#408
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/235
Author: @southpolesteve
Created: 3/3/2026
Status: ✅ Merged
Merged: 3/3/2026
Merged by: @southpolesteve
Base:
main← Head:fix/hot-route-reload-226📝 Commits (2)
d951af6Skip deploy previews for fork PRs that lack Cloudflare secretsc63b575fix: invalidate virtual RSC entry when app routes are added or removed📊 Changes
2 files changed (+25 additions, -3 deletions)
View changed files
📝
.github/workflows/deploy-examples.yml(+3 -3)📝
packages/vinext/src/index.ts(+22 -0)📄 Description
Summary
vinext devis running now work without a server restartProblem
The App Router route table is baked into the virtual RSC entry module (
virtual:vinext-rsc-entry) at generation time. When a new route file is added while the dev server is running:invalidateAppRouteCache()to clear the route scanner cacheload()hook to regenerate the entry with the updated route tableThe Pages Router was unaffected because it re-scans routes on every request via
pagesRouter(pagesDir).Fix
After clearing the route cache, also invalidate the virtual RSC entry module in Vite's module graph and send a full-reload to the RSC environment. This forces the
load()hook to re-run, regenerating the route table with the new route.The same fix applies to both file addition (
add) and file removal (unlink) handlers.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.