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

Corrupt cache #83

Open
LightningK0ala opened this issue Aug 2, 2018 · 1 comment
Open

Corrupt cache #83

LightningK0ala opened this issue Aug 2, 2018 · 1 comment

Comments

@LightningK0ala
Copy link

I just lost a couple of hours trying to debug an issue with a dependency that uses napa. I wasn't having an issue until suddenly today I started noticing the files that the folder this dependency was copying didn't contain all the files it was meant to have.

I ended up tracking the problem to an invalid napa cache (perhaps from an interrupted installation?). Since there doesn't seem to be a convenient command line flag to clear the cache I ended up setting up a separate project and using a package.json script to run the napa command on the same github repo of the broken cache and using "napa-config" to set "cache" to false.

This seems to have solved the problem, but perhaps there should be a better way to avoid this problem for future users? Either using a checksum to validate caches or only creating the cache if the process finished running?

@kylekarpack
Copy link

I also had this happen on a build server, and it was a nightmare to debug. Napa was repeatedly adding JS files that appeared to be truncated and corrupted into my build. I thought it was an issue with NPM at first, but it turned out to only be happening with packages installed by napa.

I eventually deleted the cache folder (on Windows by default it's at C:\Windows\Temp\cache) and set napa to not use its cache in the future. Adding this at the top level of package.json seems to do the trick:

"napa-config": {
    "cache": false
}

Subsequent builds are slower, but more reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants