Skip to content

New page not detected by HMR (404 until server restart) #15333

@joris-villet

Description

@joris-villet

Astro Info

Astro                    v6.0.0-beta.5
Vite                     v7.3.1
Node                     v20.19.1
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When creating a new page inside src/pages/, the dev server does not detect it.
If I navigate to the new route, Astro returns a 404.
HMR does not refresh the route list, and the page only becomes available after restarting the dev server.

Start a fresh Astro 6 beta project
Run astro dev
Create a basic Navbar.astro in components folder
Import Navbar in Layout.astro over slot
Create a new file, for example: src/pages/about.astro
Navigate to /about
Observe: 404 page
Restart the dev server
Navigate again → page now works

What's the expected result?

The new page should be detected automatically by the dev server.
As soon as the file is created inside src/pages/, navigating to its route (e.g. /about) should work without needing to restart the server.
HMR should refresh the route list and make the page available immediately.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-bbdjdxgk?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)6-betaIssues affects the beta of Astro 6regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions