-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Hugo can not find resource cache when setting a path in baseURL #9787
Comments
I am having this problem all of a sudden too. I can build locally, but I get a failed file cache error when I push to github for the action. |
I get the above failure in that starter even with a regular baseURL, which doesn't make a good test case. |
Hi bep, Thanks for your response! I got some feedback that this starter was not working with basic URL after Hugo 0.99.0, I have not looked into that (will do that soon) but this may not be the same reason as the one that has path in baseURL since the latter did not work even before Hugo 0.99.0. This starter can work with Hugo 0.97.0 at least as my CI uses this version. Update: this starter can work with Hugo 0.99.0 now with a regular baseURL, but not with basicURL with path. |
OK, now I see it. We added a new option to PostCSS in that release. In "all" the other transformers, I think I use the input options from the user as a base to create the cache key, which makes it more stable (it doesn't change if we add/remove options). In your case it means that you need to repopulate the cache with the new version, but as I'm going to make this more stable going forward, it will also mean that the hash will also change in the next version of Hugo. Also, there may be an issue with baseURL paths (which I suspect is part of the cache key, but shouldn't need to be). |
By using the input map as the basis, which means the hash will not change if we add/rename/remove options. This happened in Hugo 0.99, as we added a new options. This is unortunate. Unfortunately this means that the cache keys for PostCSS will change one more time in 0.100, but will be stable going forward. Note that we have implemented this pattern in all the other resource transformers. Updates gohugoio#9787
Thanks, bep!
Yes, it works great with regular baseURL after I updated the cache. It seems that I will do this again after Hugo 0.100 releases. And FYI, the cache is still not working if baseURL contains path after the repopulation. Hugo still tries to find cache in |
As that prevents Hugo projects with sub paths in their `baseURL` to use themes with cached resources. Fixes gohugoio#9787
As that prevents Hugo projects with sub paths in their `baseURL` to use themes with cached resources. Fixes gohugoio#9787
By using the input map as the basis, which means the hash will not change if we add/rename/remove options. This happened in Hugo 0.99, as we added a new options. This is unortunate. Unfortunately this means that the cache keys for PostCSS will change one more time in 0.100, but will be stable going forward. Note that we have implemented this pattern in all the other resource transformers. Updates #9787
As that prevents Hugo projects with sub paths in their `baseURL` to use themes with cached resources. Fixes #9787
OK, so I am clueless here... I ran a My config.yaml has this:
When I run
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
This is an issue for any theme which has a resource cache, especially those generated by PostCSS.
To reproduce it, you can use https://github.com/wangchucheng/hugo-eureka-starters as an example site and set
baseURL = example.com/test
. To force Hugo to look for cache instead of regenerating it, I setuseResourceCacheWhen = always
. The theme works well withoutbaseURL
or without resource cache.There will be an error message like:
Error: Error building site: POSTCSS: failed to transform "css/eureka.css" (text/css): resource "css/test/css/eureka.css_5423b02c25971c3328ec4f49ccfb7444" not found in file cache
when runninghugo
orhugo server
.Hugo tends to find resource cache in
css/<base-path>/...
. However, the resource cache was incss/...
. It is not possible for theme creators to know what path a user will use, so it looks like this may be a bug.The text was updated successfully, but these errors were encountered: