netlify-plugin-cache
netlify-plugin-cache copied to clipboard
Attempted to cache: .cache ... but failed. :(
I am trying to use this plugin, but I get the relatively unhelpful message
11:17:54 PM: ────────────────────────────────────────────────────────────────
11:17:54 PM: 5. netlify-plugin-cache (onSuccess event)
11:17:54 PM: ────────────────────────────────────────────────────────────────
11:17:54 PM:
11:17:56 PM: Attempted to cache: .cache ... but failed. :(
11:17:56 PM: Try setting the 'paths' input appropriately in your netlify.toml configuration.
11:17:56 PM: More details: https://jrvs.io/netlify-cache-usage
11:17:56 PM:
11:17:56 PM: (netlify-plugin-cache onSuccess completed in 2s)
I have
[[plugins]]
package = "netlify-plugin-cache"
[plugins.inputs]
paths = [".cache"]
and my build
command really writes stuff to .cache
.
What could that be? And could the error message be more helpful?
I'm investigating this right now. Probably, the bug hides in Netlify's build tool cache utility, that wasn't updated for the last year, maybe something was changed on the backend. There is no way the bug in the plugin, it's too simple to fail anywhere :)
@nomeata Any updates? The only thing I suspect now is bad file paths. Somehow, Node just does that from time to time.
When the plugin says that it did something to 2 files, it actually means 1 folder specified by the user, and node_modules directory. Yeahhh, good luck figuring it out without digging.
Tested in one of my projects, seems to work without a hiccup. The config's down below (yes, I'm using tabs for indentation):
[[plugins]]
package = "netlify-plugin-cache"
[plugins.inputs]
paths = ["assets/.cache"]
TLDR: Try a path that does not start with a dot. Maybe they put a regex for path transforms that is shooting back
No updates, sorry. I think I even forgot what precisely I was trying to do back then, and found some workaround