unfold / heroku-buildpack-pnpm

Run PNPM install on Heroku
MIT License
38 stars 39 forks source link

Node_modules not caching when deploying on dokku #27

Closed rohanrajpal closed 1 year ago

rohanrajpal commented 1 year ago

Describe the bug Hey, I'm using dokku to deploy my nestjs app. It seems that my node modules are never cached, can anyone help me figure out why?

I see that it says pnpm (nothing to cache) and dont understand why isnt there anything to cache?

Here's the log: https://gist.github.com/rohanrajpal/bc7cc3b14b3f7f3866826b0aea84f004

To Reproduce Steps to reproduce the behavior:

  1. Setup dokku.com on any ec2 instance
  2. Deploy a nestjs app setup with pnpm
  3. Node modules are never cached

Versions (please complete the following information):

Additional context The build log shared above has a lot more details

My best guess is that the path of caching is set incorrectly? Happy to make a PR if someone can point me in the right direction to fix this

rohanrajpal commented 1 year ago

On a little bit of investigation, I see that we are skipping the caching part after the build?

https://github.com/unfold/heroku-buildpack-pnpm/blob/main/bin/compile#L346

Is it because pnpm does this automatically somehow?

rohanrajpal commented 1 year ago

Alright, so the cache is indeed set. So am I right in assuming that caching is happening properly in this buildpack.

https://github.com/unfold/heroku-buildpack-pnpm/blob/main/bin/compile#L227

Node modules are installedin 38 seconds anyway, I guess that's good enough?

hampusborgos commented 1 year ago

Yea, the text is wrong. Should be nothing extra to cache. It is handled by the default cache.