turbo: When cache is hit, app can't find the package
What version of Turborepo are you using?
1.0.23
What package manager are you using / does the bug impact?
Yarn v1
What operating system are you using?
Linux
Describe the Bug
When cache it on a Rollup build in a Vercel build, then the app can’t find the package:
My build command on Vercel is: cd ../.. && yarn turbo run build --scope=builder --include-dependencies --no-deps
I’ve tried adding --no-cache, but didn’t work
Expected Behavior
If the cache is hit, it should still create the built files
To Reproduce
- Create a packaged package (webpack, rollup or else)
- Run a build a second time in a CI env so that cache is hit
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (9 by maintainers)
@jaredpalmer it looks like you’re executing it locally. Our issues happen only in the Vercel build environment.
You can find the issue on one of my project (a modest music blog in french 😅).
It’s a Next.js blog hosted on Vercel where I’ve played with turborepo by splitting the codebase in multiple packages.
Source code is here: https://github.com/guillaumewuip/cmd It does not append at every build. Last occurence of the issue a few minutes ago on: https://github.com/guillaumewuip/cmd/pull/48
Build logs
Note the multiple cache hit, even for
@cmd/domain-post. But@cmd/domain-postbuild result is not available for@cmd/blog:build.I’m adding
--forceback in the Vercel build command for now to be able to merge the PR.My build command (with
--forceadded):I confirm it works with
--forceflag. But then what’s the point 😭I added another Rollup-packaged package (with a different config) into the repo and it also fails when the cache is hit.
Have you tried to reproduce this? My guess is that it always happens in the Vercel build environment for any package built from a module bundler.
Guys, that’s so dumb but I forgot to add the distribution folder in the
outputsfield in config.That solves the issue.
More info: https://turborepo.org/docs/features/caching
Please file support tickets with Vercel if this is still happening. Thanks!
@flowirtz investigating. In the future, file a support ticket with Vercel