Error when deploying with Cloudflare Pages

I successfully deployed my site with Cloudflare Pages a few days ago. Today I made some updates, pushed to github, but Cloudflare build failed. It seems to clone my repository and install the requested version of Hugo, but it fails to load the theme I’m using when it runs the command hugo.

When I run hugo on my machine, it works fine. Is this a Cloudflare issue? Or is it something I’ve changed without knowing it?

Here’s the complete log:

2025-03-12T05:17:32.73899Z	Cloning repository...
2025-03-12T05:17:34.203815Z	From https://github.com/morgansr/supply-chain-security-handbook
2025-03-12T05:17:34.204293Z	 * branch            8ad5ddc16d22969883f2d577d4b2c2cffa58170b -> FETCH_HEAD
2025-03-12T05:17:34.204415Z	
2025-03-12T05:17:34.317308Z	HEAD is now at 8ad5ddc feels like I did something to make thsi break, but it works on my machine...
2025-03-12T05:17:34.31811Z	
2025-03-12T05:17:34.398441Z	
2025-03-12T05:17:34.398984Z	Using v2 root directory strategy
2025-03-12T05:17:34.419705Z	Success: Finished cloning repository files
2025-03-12T05:17:35.965893Z	Checking for configuration in a Wrangler configuration file
 (BETA)
2025-03-12T05:17:35.966506Z	
2025-03-12T05:17:37.066061Z	No wrangler.toml file found. Continuing.
2025-03-12T05:17:37.531042Z	Detected the following tools from environment: hugo@extended_0.145.0
2025-03-12T05:17:37.53161Z	Installing hugo extended_0.145.0
2025-03-12T05:17:37.65541Z	* Downloading hugo release extended_0.145.0...
2025-03-12T05:17:39.125351Z	hugo extended_0.145.0 installation was successful!
2025-03-12T05:17:39.403708Z	Executing user command: hugo
2025-03-12T05:17:39.650784Z	Total in 2 ms
2025-03-12T05:17:39.651773Z	Error: failed to load modules: module "hugo-book" not found
  in "/opt/buildhome/repo/themes/hugo-book"; either add it as a Hugo Module or store it in
 "/opt/buildhome/repo/themes".: module does not exist
2025-03-12T05:17:39.655261Z	Failed: Error while executing user command. Exited with
 `Preformatted text`error code: 1
2025-03-12T05:17:39.664361Z	Failed: build command exited with code: 1
2025-03-12T05:17:40.354896Z	Failed: error occurred while running build command

It seems that you use your theme as a git submodule. I don’t know how/where you build the site, but my guess is that it only checks out the main repo, without the submodules. Your build should run something like git submodule update --init --recursive --depth 1