diff --git a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts index e95026ab19ef..9ec940c6817f 100644 --- a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts +++ b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts @@ -60,6 +60,7 @@ export function vitePluginAstroPreview(settings: AstroSettings): Plugin { } } + // TODO: look into why the replacement needs to happen here for (const middleware of server.middlewares.stack) { // This hardcoded name will not break between Vite versions if ((middleware.handle as Connect.HandleFunction).name === 'vite404Middleware') {