-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Middleware not updating during dev #15993
Copy link
Copy link
Closed
Labels
- P4: importantViolate documented behavior or significantly impacts performance (priority)Violate documented behavior or significantly impacts performance (priority)pkg: astroRelated to the core `astro` package (scope)Related to the core `astro` package (scope)
Description
Astro Info
Astro v6.0.6
Vite v7.3.1
Node v25.8.1
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs/node (v10.0.2)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Having a basic middleware like this, works fine:
import { defineMiddleware } from "astro:middleware";
export const onRequest = defineMiddleware((ctx, next) => {
console.log("a");
return next();
});(the output is "a")
but if I change it to:
import { defineMiddleware } from "astro:middleware";
export const onRequest = defineMiddleware((ctx, next) => {
console.log("b");
return next();
});The output is still "a", and a full reload of the dev server is needed to have it change to "b"
What's the expected result?
The expected result is not having to reload the dev server for every middleware change.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-vwqjqzv6?file=src%2Fmiddleware.ts
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P4: importantViolate documented behavior or significantly impacts performance (priority)Violate documented behavior or significantly impacts performance (priority)pkg: astroRelated to the core `astro` package (scope)Related to the core `astro` package (scope)