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 b07b88b7ad99..7f9979275607 100644 --- a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts +++ b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts @@ -25,7 +25,7 @@ export function vitePluginAstroPreview(settings: AstroSettings): Plugin { } const strippedPathname = stripBase(req.url!, base); - const pathname = new URL(strippedPathname, 'https://a.b').pathname + const pathname = new URL(strippedPathname, 'https://a.b').pathname; const isRoot = pathname === '/'; // Validate trailingSlash