diff --git a/.changeset/real-bags-hope.md b/.changeset/real-bags-hope.md new file mode 100644 index 000000000000..86fb6678329d --- /dev/null +++ b/.changeset/real-bags-hope.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix Astro failing to build on certain exotic platform that reports their CPU count incorrectly diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 486fac9fbcf0..9dc80f8223f0 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -220,7 +220,7 @@ export async function generatePages(opts: StaticBuildOptions, internals: BuildIn .reduce((a, b) => a + b, 0); const cpuCount = os.cpus().length; const assetsCreationEnvironment = await prepareAssetsGenerationEnv(pipeline, totalCount); - const queue = new PQueue({ concurrency: cpuCount }); + const queue = new PQueue({ concurrency: Math.max(cpuCount, 1) }); const assetsTimer = performance.now(); for (const [originalPath, transforms] of staticImageList) {