Skip to content
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

Resetting cache when packages dependencies have changes #94

Open
kickbk opened this issue Mar 3, 2023 · 1 comment
Open

Resetting cache when packages dependencies have changes #94

kickbk opened this issue Mar 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kickbk
Copy link

kickbk commented Mar 3, 2023

I noticed that if I update dependencies in one of the packages, while I previously ran a build via GitHub actions, then next time I deploy, it will use the outdated cache stored on GitHub and this will finally generate an app on EAS using the old packages dependencies.
I know we invalidate Metro cache when env vars change, but what about the cache that needs to be invalidated when updating package dependencies?

Currently metro.json has:

"build": {
  "dependsOn": ["^build"],
  "outputs": [
    ".next/**",
    "build/**",
    "node_modules/.cache/metro/**"
  ],
  "env": [
    ...
  ]
},

Or maybe I'm missing something, if so, could you please let me know what?

@kickbk kickbk added the bug Something isn't working label Mar 3, 2023
@byCedric
Copy link
Owner

Technically speaking, that should have been covered by Metro itself. Metro's own caching should have detected that files were changed, and it needs to transpile the package again. I'm not sure what kind of change you made, but if you have an example, I'd be happy to debug it.

What you can do for now to avoid this in the future is to disable the cache in GitHub Actions. That way, you are always sure you are building from the source without possible incorrect caches. It might slow down your CI a bit, but I think stability should be preferred over performance in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants