Build error on Hugo site: module not found

I am trying to deploy a Hugo site on Netlify.
Github repository: https://github.com/JJ-Kamminga/jakobjankamminga
Netlify site: agitated-curran-41fd3b

It builds locally without errors or notifications. I also followed the common issues post. But I get one specific error that I can hardly find anywhere:

6:51:39 PM: Error: module "pulp" not found; either add it as a Hugo Module or store it in "/opt/build/repo/themes".: module does not exist

‘pulp’ is my Hugo theme. I have installed it as a git submodule as instructed. But it seems the deploy log is talking about Hugo modules specifically. But I am building on a Hugo theme, and definitely did not add any Hugo modules myself. There is no mention of it in my config file except for it being listed as the theme.

It could be that I should check over at Hugo for this issue. But then again, it comes up as an error in the Netlify deploy, not in my local build. So I am trying here first.

Help/insight much appreciated!

Deploy log:
6:51:18 PM: Build ready to start 6:51:23 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12 6:51:23 PM: build-image tag: v2.8.2 6:51:23 PM: buildbot version: 42a7c7b5aff184339e8bdfbef0257099997cd97c 6:51:23 PM: Fetching cached dependencies 6:51:23 PM: Failed to fetch cache, continuing with build 6:51:23 PM: Starting to prepare the repo for build 6:51:24 PM: No cached dependencies found. Cloning fresh repo 6:51:24 PM: git clone https://github.com/JJ-Kamminga/jakobjankamminga 6:51:24 PM: Preparing Git Reference refs/heads/master 6:51:25 PM: Found netlify.toml. Overriding site configuration 6:51:25 PM: Starting build script 6:51:25 PM: Installing dependencies 6:51:26 PM: Downloading and installing node v8.16.2... 6:51:26 PM: Downloading https://nodejs.org/dist/v8.16.2/node-v8.16.2-linux-x64.tar.xz... 6:51:26 PM: ################################### 6:51:26 PM: ### 53.6% 6:51:26 PM: ################################################## 6:51:26 PM: ###################### 100.0% 6:51:26 PM: Computing checksum with sha256sum 6:51:26 PM: Checksums matched! 6:51:29 PM: Now using node v8.16.2 (npm v6.4.1) 6:51:29 PM: Attempting ruby version 2.3.6, read from environment 6:51:30 PM: Using ruby version 2.3.6 6:51:30 PM: Using PHP version 5.6 6:51:30 PM: Installing Hugo 0.59.1 6:51:32 PM: Hugo Static Site Generator v0.59.1-D5DAB232 linux/amd64 BuildDate: 2019-10-31T15:21:02Z 6:51:32 PM: Started restoring cached go cache 6:51:32 PM: Finished restoring cached go cache 6:51:32 PM: Installing Go version 1.10 6:51:39 PM: unset GOOS; 6:51:39 PM: unset GOARCH; 6:51:39 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64'; 6:51:39 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}"; 6:51:39 PM: go version >&2; 6:51:39 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env" 6:51:39 PM: go version go1.10 linux/amd64 6:51:39 PM: Installing missing commands 6:51:39 PM: Verify run directory 6:51:39 PM: Executing user command: hugo 6:51:39 PM: Error: module "pulp" not found; either add it as a Hugo Module or store it in "/opt/build/repo/themes".: module does not exist 6:51:39 PM: Skipping functions preparation step: no functions directory set 6:51:39 PM: Caching artifacts 6:51:39 PM: Started saving pip cache 6:51:39 PM: Finished saving pip cache 6:51:39 PM: Started saving emacs cask dependencies 6:51:39 PM: Finished saving emacs cask dependencies 6:51:39 PM: Started saving maven dependencies 6:51:39 PM: Finished saving maven dependencies 6:51:39 PM: Started saving boot dependencies 6:51:39 PM: Finished saving boot dependencies 6:51:40 PM: Started saving go dependencies 6:51:41 PM: Finished saving go dependencies 6:51:44 PM: Error running command: Build script returned non-zero exit code: 255 6:51:44 PM: Failing build: Failed to build site 6:51:44 PM: failed during stage 'building site': Build script returned non-zero exit code: 255 6:51:44 PM: Finished processing build request in 21.258723423s

I feel really stupid now - especially because I’ve had this error before some months ago and I totally forgot about the solution.

It’s actually simple: I didn’t notice the themes directory, being a git submodule 'n all, wasn’t being included in my commits. So it couldn’t be found by Netlify (duh). Solved it by removing all .git files in the theme’s directory.

We believe pretty strongly in “no stupid questions” here, @JKamminga - it’s a company value and in the community we definitely aim to practice what we preach! What makes this especially smart, in my book, besides the willingness to ask and diagnose yourself - is that you followed up here, with your solution, so that future-you, or more likely, the next customer with the same problem - this is somewhat of a FAQ - can find the answer.

Kudos and have a great weekend!

1 Like

I just watched

Which clarifies the use of sub-modules a little.

But it seems that the point of a sub-module is to be able to maintain separation of development paths.

A little more research no Stack Overflow where @fool mentions that the submodule needs to be set up intentionally.

Then this article describes how to do it.

Leaving this here for my future self.

Thanks for sharing that, @brianball!

1 Like