Astro Info
Astro v5.16.7
Vite v6.4.1
Node v22.20.0
System macOS (arm64)
Package Manager pnpm
Output static
Adapter @astrojs/netlify (v6.6.3)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I'm using the experimental fonts API and have no problem with my live site, or with astro dev, or with netlify serve.
But I've noticed recently (not sure when) that netlify dev 404's on every font.
I used middleware to show that with netlify dev, a request is made for the font, whereas with netlify serve and astro dev, it bypasses middleware as expected:
import { defineMiddleware } from "astro:middleware";
export const onRequest = defineMiddleware(async (context, next) => {
const url = new URL(context.request.url);
if (url.pathname.startsWith("/_astro/fonts/")) {
// astro dev and netlify log no request for fonts
// but netlify dev does
console.log("Font was requested:", url.pathname);
}
return await next();
});
The issue does not occur with fonts loaded normally with @font-face.
Note: If netlify dev doesn't work on the stackblitz example (I can't get it to), please see my example repo
discord support thread
What's the expected result?
Fonts via the experimental fonts API should be served when using netlify dev
Link to Minimal Reproducible Example
https://stackblitz.com/github/paulrudy/netlify-dev-fonts?file=src%2Fmiddleware.ts
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I'm using the experimental fonts API and have no problem with my live site, or with
astro dev, or withnetlify serve.But I've noticed recently (not sure when) that
netlify dev404's on every font.I used middleware to show that with
netlify dev, a request is made for the font, whereas withnetlify serveandastro dev, it bypasses middleware as expected:The issue does not occur with fonts loaded normally with
@font-face.Note: If
netlify devdoesn't work on the stackblitz example (I can't get it to), please see my example repodiscord support thread
What's the expected result?
Fonts via the experimental fonts API should be served when using
netlify devLink to Minimal Reproducible Example
https://stackblitz.com/github/paulrudy/netlify-dev-fonts?file=src%2Fmiddleware.ts
Participation