From 046bfd908de8bbfe9d24d1531260f1e6df03e912 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 29 Aug 2022 23:59:25 +0800 Subject: [PATCH] Skip clean SSR output if page generation fails (#4526) --- .changeset/nine-beans-divide.md | 5 +++++ packages/astro/src/core/build/static-build.ts | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .changeset/nine-beans-divide.md diff --git a/.changeset/nine-beans-divide.md b/.changeset/nine-beans-divide.md new file mode 100644 index 000000000..ab251faa4 --- /dev/null +++ b/.changeset/nine-beans-divide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Skip clean SSR output if page generation fails diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 48ace69c0..074e01f83 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -96,11 +96,8 @@ Example: timer.generate = performance.now(); if (astroConfig.output === 'static') { - try { - await generatePages(opts, internals); - } finally { - await cleanSsrOutput(opts); - } + await generatePages(opts, internals); + await cleanSsrOutput(opts); } else { // Inject the manifest await injectManifest(opts, internals);