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

Attempted to cache: .cache ... but failed. :( #27

Open
nomeata opened this issue Feb 16, 2022 · 4 comments
Open

Attempted to cache: .cache ... but failed. :( #27

nomeata opened this issue Feb 16, 2022 · 4 comments

Comments

@nomeata
Copy link

nomeata commented Feb 16, 2022

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?

@maddsua
Copy link

maddsua commented Mar 18, 2023

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 :)

@maddsua
Copy link

maddsua commented Mar 25, 2023

@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"]

@maddsua
Copy link

maddsua commented Mar 25, 2023

TLDR: Try a path that does not start with a dot. Maybe they put a regex for path transforms that is shooting back

@nomeata
Copy link
Author

nomeata commented Mar 26, 2023

No updates, sorry. I think I even forgot what precisely I was trying to do back then, and found some workaround

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