Closed osdiab closed 2 years ago
I found another issue: now that I did this, it works fine. BUT, when Yarn prunes devDependencies
, yarn berry
fails to find anything in the caches (probably since I slugignored it Nevermind, I un-slugignored it and it still does the same thing). so my builds end up re-fetching everything, defeating the purpose of caching:
@osdiab there's a new buildpack version out today that I think should resolve your issues. You shouldn't need NODE_MODULES_CACHE=true
, and maybe the .slugignore
.
Thanks for letting me know - I'm not working on this project anymore but I'll let my old coworkers know!
Omar
On Tue, Feb 15, 2022 at 6:34 AM, Josh W Lewis @.***> wrote:
@osdiab https://github.com/osdiab there's a new buildpack version out today that I think should resolve your issues. You shouldn't need NODE_MODULES_CACHE=true, and maybe the .slugignore.
— Reply to this email directly, view it on GitHub https://github.com/heroku/heroku-buildpack-nodejs/issues/915#issuecomment-1039587675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAONU3SPH5KPPINMSFL6LVDU3FYODANCNFSM444AEQRQ . You are receiving this because you were mentioned.Message ID: @.***>
Sorry to revive this but @joshwlewis what was changed with that fix? I still see .yarn/cache
in the slug consuming space.
Is your enhancement request related to a problem? Please describe. My company's repo became unable to deploy after switching to
yarn 2
/ berry with zero-installs, because the slug size was too large.Therefore I added
.yarn/cache
to our.slugignore
file so that it wouldn't be included in the slug. That made it work, but it also makesyarn install
take a long time instead of 2 seconds like it does when it uses zero-installs (as well as losing the stability benefit of having checked-in dependencies instead of relying on registries to have everything intact).Describe the solution you'd like Exclude or delete the
.yarn/cache
folder from the resulting slug. It's not necessary after the first install and it doubled my slug size, pushing us over the slug limit.Describe alternatives you've considered Ignoring it in
.slugignore
, and enablingNODE_MODULES_CACHE=true
. This is alright, but I'd prefer if we can leverageyarn 2
's zero-installs instead of selectively disabling it in Heroku. But if this is the direction Heroku wants to go in, at least add that advice to the docs for migrating to Yarn 2, as well as debugging slug size.