I am trying to deploy a Hugo static website to vercel via gitlab and having issues with theme submodule installation. Locally it is installed via git submodule add https://github.com/dsrkafuu/hugo-theme-fuji.git themes/fuji and it works.
When doing the deployment to vercel, apparently the theme is not fetched.
What was tried:
- Deploying locally and pushing
publicdirectory with built htmls into the repo from where it was fetched by vercel, while pointing Output Dierctory and/or root directory to public (and all other combinations of these parameters). - Using vercel-CLI to do the same.
- Creating a shell script to trigger it in the install step of deployment (npm vercel-install) in vercel following this, but I get
Command "yarn vercel-install" exited with 128orCommand "npm vercel-install" exited with 1 - Cloning the theme repo into the right place via
Install Commandparameter manually.
Do you know how a submodule can be properly fetched in vercel deployment?
I recently faced this problem and it turned out to be not with git submodules but the default hugo version inside vercel is too old.
You can specify Hugo version by using
HUGO_VERSIONenvironment variable and set it to a recent release.Possible causes:
config.tomltohugo.toml, thus hugo inside vercel(default to v0.58.2) cannot recognize the config, and it won't know which theme you selected.