Workers "Build Cache" not working in monorepos + pnpm
I have a monorepo, setup with Turborepo with the following structure
api, app, and web are separate workers each with Build Cache enabled, and appropriate Root Directory set in their Build Configuration.
Here’s an example of the build configuration for app:
Here are the related build variables for app:
While reading the docs and searching on the forum, shows that Build Cache should be supported out-of-the-box for pnpm, during my build/deployment, I see that all dependencies are always redownloaded and the cache is not properly hit.
I have tried to manually create and set the .pnpm-store directory. However this is only possible in the root directory which is /opt/buildhome/repo/apps/app/.pnpm-store. Trying to set the store directory in the root of repo (/opt/buildhome/repo/.pnpm-store) results in permission denied issues.
My primary concern is that during installation all dependencies are re-downloaded rather than being immediately resolved from the store. Also I receive Skipping build output cache as it's not supported for your project at the end of my project build.0 Replies