I’m having issues with my monorepo deployment using app platform. I’m using yarn workspaces to manage dependencies. When running a new deploy and using the node_modules cache, the build fails with missing modules.
My monorepo folder structure is basically like this:
apps/
server/
web/
packages/
common/
yarn.lock
I’m using turborepo to manage the build pipeline, so I use the root directory as source_dir
. Each app runs as a service in my app, with build command like this yarn build --scope="<app>" --include-dependencies
, which builds local dependencies before building the app.
Whenever the cache layer is restored, the following build fails with missing node_modules. I can work around this issue by simply forcing a redeploy without cache, but it is kind of tedious.
I wonder if there is some general caching issue with yarn workspaces? Haven’t been able to find anything in documentation suggesting another configuration. Could work on a reproducible repo if there is no immediate suspicion.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I am experiencing the same issue
I share a similar setup and facing the exact same problem.
Here is a snippet from the log.