Summary
The dev server's getRoute page router runs before the publicDir static-file handler, and its catch-all [...all].stx matches ^(.+)$. So a request for a static asset — e.g. GET /images/logo.jpg — is matched by the catch-all and returns the 404 page HTML before publicDir ever gets to serve the real file. Every public/ asset is shadowed by the catch-all.
This is distinct from #1837 (catch-all vs dynamic routes): assets have no specific route, so ordering alone doesn't help — the catch-all is still the only match.
Repro
public/images/logo.jpg
resources/views/[...all].stx (the 404 catch-all)GET /images/logo.jpg → serves the 404 page HTML (broken image), not public/images/logo.jpg.
Why framework CSS/JS survive but images don't
Framework assets (/_stx/runtime.js, /_stx/crosswind.*.css, /assets/*) are served by handlers that run before getRoute. Only publicDir assets are served after getRoute (handler order: page router → publicDir → 404), so they're the ones the catch-all shadows.
Fix
A catch-all page must never match a static-asset request. In getRoute's dynamic loop, drop catch-all candidates when the path carries a non-page file extension, so the request falls through to publicDir (and then the real 404 page). Specific routes may still match an extensioned path (e.g. download/[file].stx for /download/report.pdf).
export function isStaticAssetPath(p: string): boolean {
return /\.[a-z0-9]+$/i.test(p) && !/\.(?:stx|md|html)$/i.test(p)
}
// in getRoute: if (isStaticAssetPath(normalizedPath)) drop [...catch-all] candidatesLocation
packages/bun-plugin/src/serve.ts — getRoute "Strategy 6" dynamic loop.