Having a pnpm-workspace is breaking the deploy on Cloudflare
Hello,
On multiple project, as soon as I approve some build (let's say prisma) by running
pnpm approve-builds it generates a pnpm-workspace in addition to my package.json automatically.
As soon as this file is present, my Cloudflare Worker stops deploying
why ?1 Reply
the pnpm-workspace.yaml file:
LLM answer, did the trick :
Simply add a packages: field to your pnpm-workspace.yaml file. Since you're not using a monorepo, just add the root: I've already made the fix - I addedpackages: ['.']at the beginning of the file. This tells pnpm that your main package is at the project root. Now your Cloudflare Pages deployment should work correctly. Thepnpm-workspace.yamlfile is valid and pnpm won't complain about the missing packages field anymore. Important note: Each time you run pnpm approve-builds, it may recreate this file without the packages: field. You'll then need to add it back manually. This is a known bug in pnpm v10 that hasn't been fixed yet.