-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pnpm's dependenciesMeta.*.injected can't re-sync #2306
Comments
I am never really sure when you are supposed to use Why do you need to inject the dependency? |
You need to inject a library when that library is in your monorepo, and that library declares peers (that are also devDeps) that the consumers of the library is supposed to declare. Otherwise peers don't resolve correctly -- they resolve to your library's devDeps, instead of the consumer's deps |
A possibly better workaround: create a root task called For bonus points this addresses merge-caused We're not planning to do anything with this (other than recommend the most-elegant of workarounds) so I will close this. 🤷♂️ Thank you for filing the issue; it really helps to see what people are encountering. |
…ms like resync finishes too early, and we need it to run specifically after the library build
After further discussion, I discovered that this is a request to run things at the leaf nodes, not at the root: after we have already acquired all of the information necessary to know if we would need to do this. We should definitely patch up this papercut; we are actually even better positioned to do this. |
Looks like I am having a similar issue now after importing some package heavy project in my monorepo playground. @NullVoxPopuli Did you had luck with @nathanhammond suggestion? |
@weyert My pitch doesn't work (which is why I reopened this). |
In case someone needs this, there is an issue in pnpm with a reproduction repo that we can use to test solutions: |
To be clear though, that fix also causes the behavior reported and linked in the original post in this thread. |
This is a squashed commit, for easier rebasing and conflict resolution. Previous topics in now hidden commits: chore(turbo): try suggestion from: vercel/turbo#2306 (comment) -- seems like resync finishes too early, and we need it to run specifically after the library build chore(turbo, ci): setup turbo before pnpm install chore(turbo): try cache-hit chore(scripts): tidy up the start meta-script
This is a squashed commit, for easier rebasing and conflict resolution. Previous topics in now hidden commits: chore(turbo): try suggestion from: vercel/turbo#2306 (comment) -- seems like resync finishes too early, and we need it to run specifically after the library build chore(turbo, ci): setup turbo before pnpm install chore(turbo): try cache-hit chore(scripts): tidy up the start meta-script
@simonihmig came up with a way to make this work over at: CrowdStrike/ember-headless-form#52 It requires this util: https://github.com/CrowdStrike/ember-headless-form/pull/52/files#diff-cba6a6cd1877ea907fa4d3c06bdd8548011bc52b603638c9e8334870e53aca39 does it make sense for turborepo to adopt? or maybe it could be a util for pnpm -- since pnpm is already written in js/ts |
Here is a work-around if folks run in to this: https://github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected |
Closing this out as the related pnpm discussion also suggests that it's not a turborepo-specific problem. |
there is probably a meta issue here (or somewhere) where folks may want to run something that isn't cached before running a regular task (that could be cached). for example:
|
What version of Turborepo are you using?
1.6.1
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Linux
Describe the Bug
When using pnpm
s
dependenciesMeta.*.injectedfeature (to make deep peers work), rebuilding the libraries to get the
distfolder back requires "re-syncing" via
pnpm install` (which takes ~1s)See this related issue on the pnpm repo: pnpm/pnpm#4965 (comment)
Expected Behavior
This is more a bug with
pnpm
, I think, and I don't know what turbo could do differently -- I'm mostly reporting for SEO / audit-trail purposes (so feel free to close this issue, if there is nothing turbo can do). As a work-around I thought of withoutturbo
would no longer work withturbo
-- and that work around is to addpnpm i;
as a prefix to every script -- quite obnoxious, and the only real solution is to probably fix the issue in pnpm (which.. I'm not sure even how to approach the problem of re-syncing -- does pnpm need a background daemon that does the re-syncing? I'm not sure).To Reproduce
I have a sample / repro here: CrowdStrike/ember-headless-table#44
It's gone through a number of iterations, but demonstrates:
The text was updated successfully, but these errors were encountered: