From 5d09b30051631f9aacd614ce5a3ef3846cf6e053 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 21 Jun 2024 14:52:06 -0400 Subject: [PATCH] astro metadata can be undefined --- .../src/core/server-islands/vite-plugin-server-islands.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/core/server-islands/vite-plugin-server-islands.ts b/packages/astro/src/core/server-islands/vite-plugin-server-islands.ts index 46f1895f19..d2455d6be3 100644 --- a/packages/astro/src/core/server-islands/vite-plugin-server-islands.ts +++ b/packages/astro/src/core/server-islands/vite-plugin-server-islands.ts @@ -14,8 +14,8 @@ export function vitePluginServerIslands({ settings }: { settings: AstroSettings if(id.endsWith('.astro')) { const info = this.getModuleInfo(id); if(info?.meta) { - const astro = info.meta.astro as AstroPluginMetadata['astro']; - if(astro.serverComponents.length) { + const astro = info.meta.astro as AstroPluginMetadata['astro'] | undefined; + if(astro?.serverComponents.length) { if(viteServer) { for(const comp of astro.serverComponents) { if(!settings.serverIslandNameMap.has(comp.resolvedPath)) {