Error when deploying to Cloudfare Pages

Wondering if someone might be able to help me with an error I am getting during the deployment of a Hugo static site to Cloudflare Pages.

When I try to deploy my Hugo static site to Cloudflare Pages the deployment fails on the cloning step:

14:10:19.063 Initializing build environment. This may take up to a few minutes to complete
14:10:53.457 Success: Finished initializing build environment
14:10:53.457 Cloning repository…
14:10:55.663 Failed: an internal error occurred

Looking through forum posts similar to this I have checked the root path and that there aren’t any extremely long file names (at least I think so). The repo itself is 100kb, so I don’t think it’s a size issue.

Figured it out, it was failing cloning due to a submodule error. I needed to create a .gitmodules file in my root directory for the theme I was using.

e.g

[submodule "themes/hugo-theme-learn"]
path = themes/hugo-theme-learn
url = https://github.com/matcornic/hugo-theme-learn.git

More information here: https://stackoverflow.com/questions/53625208/failing-to-deploy-website-on-netlify-when-trying-to-use-alternate-hexo-theme