From 2f0b823f28f22d6032281efdc25fc5c3e878519d Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Fri, 5 Aug 2022 13:00:44 -0700 Subject: [PATCH] do not resolve renderer.serverEntrypoint url before loading it (#4143) --- packages/astro/src/core/render/dev/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/astro/src/core/render/dev/index.ts b/packages/astro/src/core/render/dev/index.ts index 7463fd07c..46364b821 100644 --- a/packages/astro/src/core/render/dev/index.ts +++ b/packages/astro/src/core/render/dev/index.ts @@ -51,13 +51,7 @@ async function loadRenderer( viteServer: ViteDevServer, renderer: AstroRenderer ): Promise { - // Vite modules can be out-of-date when using an un-resolved url - // We also encountered inconsistencies when using the resolveUrl and resolveId helpers - // We've found that pulling the ID directly from the urlToModuleMap is the most stable! - const id = - viteServer.moduleGraph.urlToModuleMap.get(renderer.serverEntrypoint)?.id ?? - renderer.serverEntrypoint; - const mod = (await viteServer.ssrLoadModule(id)) as { default: SSRLoadedRenderer['ssr'] }; + const mod = (await viteServer.ssrLoadModule(renderer.serverEntrypoint)) as { default: SSRLoadedRenderer['ssr'] }; return { ...renderer, ssr: mod.default }; }