From 46f6b386b3db6332f286d79958ef10261958cceb Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 19 Nov 2024 16:12:40 +0000 Subject: [PATCH] fix(build): generated entry (#12477) --- .changeset/thin-cups-peel.md | 5 +++++ packages/astro/src/core/build/plugins/plugin-ssr.ts | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changeset/thin-cups-peel.md diff --git a/.changeset/thin-cups-peel.md b/.changeset/thin-cups-peel.md new file mode 100644 index 0000000000..3fc4678cb5 --- /dev/null +++ b/.changeset/thin-cups-peel.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes an issue where the SSR build was emitting the `dist/server/entry.mjs` file with an incorrect import at the top of the file/ diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts index 883cdee388..eb59eff650 100644 --- a/packages/astro/src/core/build/plugins/plugin-ssr.ts +++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts @@ -283,7 +283,6 @@ function generateSSRCode(settings: AstroSettings, adapter: AstroAdapter, middlew `import { renderers } from '${RENDERERS_MODULE_ID}';`, `import * as serverEntrypointModule from '${ADAPTER_VIRTUAL_MODULE_ID}';`, `import { manifest as defaultManifest } from '${SSR_MANIFEST_VIRTUAL_MODULE_ID}';`, - edgeMiddleware ? `` : `import { onRequest as middleware } from '${middlewareId}';`, settings.config.experimental.serverIslands ? `import { serverIslandMap } from '${VIRTUAL_ISLAND_MAP_ID}';` : '',