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);