Build failing with ENOSPC: no space left on device for monorepo project on Cloudflare Workers Build.
Hi everyone,
I'm encountering an error while trying to build my monorepo project using Cloudflare Workers Builds. The build process fails during the yarn install --production step with multiple "ENOSPC: no space left on device" errors.
Build Command:
yarn install --production && yarn build:cf --filter=web
Environment:
- Node.js: v22.9.0
- Yarn: v4.5.0 (via Corepack, falling back to v1.22.22 as seen in logs)
- SKIP_DEPENDENCY_INSTALL environment variable is set.
Issue:
The build fails when fetching and extracting packages, specifically mentioning packages like @img/sharp-libvips-* and next. The error message consistently points to "no space left on device".
I found a similar issue reported on the Cloudflare Community forum, which suggests this might be related to build limitations:
https://community.cloudflare.com/t/enospc-no-space-left-on-device-in-cloudflare-workers-when-deploying-next-js-app/756472
Question:
My question is: Given that this seems related to build limitations, especially with monorepo structures potentially requiring more disk space during the build, are there any plans to ease these limitations, perhaps by the time Workers Builds reaches General Availability (GA)? We seem to be hitting the current limits with our monorepo setup.
Any insights or information on future plans regarding build resource limits would be greatly appreciated.
Thanks.5 Replies
To be fair, Pages had ~100GB disk (and much faster disk too), while Workers CI, despite being the paid platform, has much lower limits at ~8GB. 😦
it's only ~5 gb or so before any deps, just base build image
08:47:00.911 Filesystem Size Used Avail Use% Mounted on 08:47:00.911 /dev/vdc 7.8G 2.5G 4.9G 34% /and then you have node deps + package deps, ehh
yeah, I have been using workers paid plan.
and
In my monorepo setup,
I switched from using 'cloudflare pages' to 'workers' but kept the same package structure, and now I'm running into this error....
thanks a lot 🙌
I discovered that my monorepo's package size is 7,612,353,195 bytes (7.94 GB) including node_modules, possibly surpassing the Cloudflare Workers build limit.
This suggests that for large monorepo projects, the existing build limits may indeed be quite restrictive for users.
ref builds limit:
https://developers.cloudflare.com/workers/ci-cd/builds/limits-and-pricing/