Hi all,
I noticed recently that my Netlify-hosted site was not building anymore. This is my GH repo.
The latest working build occurred before this commit, in which I commented a few lines, but in the wrong way. I immediately noticed the syntax error I made and fixed the commit with this:
Even with the part commented out (heck, even with it removed!) it does not build anymore.
What’s wrong? Has something changed in Netlify? I noticed the NODE version changed, but forcing the build with the old version in netlify.toml had no impact.
2:23:05 PM: Error: Unable to find theme Directory: /opt/build/repo/themes/academic
It seems to me the theme can’t be found. How are you making sure the (external) theme is there at build time? You made some changes to the .gitmodules file, maybe that’s the culprit. Go on an error hunt and checkout your site locally in a new folder to make sure it still builds outside of netlify.
Also: did you try to just rebuild without the cached build-environment? The latest broken deploy has this option in a dropdown. It might be as simple as that.
There is a mismatch between your theme location and where Hugo looks for it (the default location). I assume that you somehow set the HUGO_THEMESDIR or run with the --themesDir flag set back when it was working …
I agree that this is probably a theme error. I never managed the theme in use (Academic). I can’t for the life of me understand why Hugo was previously looking for it in ./themes and now instead uses /opt/build/repo/themes/
The build succeeds locally with no error.
I now tried readding the .gitmodules and the academic.Rproj files, but it still does not work.
I never ever did anything regarding the theme (academic), I just cloned the academic repo. It might be that I changed something without knowing it, but not in the last (harmless) commit before it broke… then when?
Apparently the 0.53 version of hugo was discontinued for this theme. 0.55 and 0.56 do not exist, because hugo switched to semantic versioning, so e.g. 0.56.0 in netlify.toml works.
I think what did it was reinitialise the submodule with git submodule update --init --recursive then set a new version in netlify.toml.