Home
Support Forums

Hugo Deploy Different from Local Build

Hey there, thanks for reading…I tried to solve from other posts, but kept coming up short for these issues. Hoping I’m missing something silly.

Most of the site builds correctly, but some weird things are messed up. Footers with buttons and links are missing from my cards, and the /posts/ page uses my default list.html but not the custom post.html.
Everything is fine on the hugo server local build.

baseURL is set to https://eamonn.netlify.app/ although I also tried my custom domain https://eamonncottrell.com/ to the same effect
I copied and pasted the netlify.toml file from Hugo even though logs before that were properly building from v0.88.1 which I am using on my local machine.

Side by side pics of local (left) vs deployed (right) to illustrate the differences. I’m scratching my head more than normal simply because most things are working properly and I don’t understand why some of these parts are not while others are.

Netlify Site Name: eamonn
Deployed Site: https://www.eamonncottrell.com/
Github: GitHub - sieis/cottrell-theme: My Hugo portfolio theme using Bootstrap 5

Build Log:
5:41:12 PM: Build ready to start
5:41:16 PM: build-image version: 8925038cf853b22d6397cdcb9904ac88b66bb383 (focal)
5:41:16 PM: build-image tag: v4.5.0
5:41:16 PM: buildbot version: 1166b873df3086892bcef41356ad6efa7b9e401d
5:41:16 PM: Fetching cached dependencies
5:41:16 PM: Starting to download cache of 92.3MB
5:41:17 PM: Finished downloading cache in 472.656011ms
5:41:17 PM: Starting to extract cache
5:41:20 PM: Finished extracting cache in 3.068720344s
5:41:20 PM: Finished fetching cache in 3.572321745s
5:41:20 PM: Starting to prepare the repo for build
5:41:20 PM: Preparing Git Reference refs/heads/main
5:41:20 PM: Parsing package.json dependencies
5:41:21 PM: Different build command detected, going to use the one specified in the Netlify configuration file: ‘hugo --gc --minify’ versus ‘hugo’ in the Netlify UI
5:41:21 PM: Starting build script
5:41:21 PM: Installing dependencies
5:41:21 PM: Python version set to 2.7
5:41:21 PM: Started restoring cached node version
5:41:23 PM: Finished restoring cached node version
5:41:24 PM: v16.13.0 is already installed.
5:41:25 PM: Now using node v16.13.0 (npm v8.1.0)
5:41:25 PM: Started restoring cached build plugins
5:41:25 PM: Finished restoring cached build plugins
5:41:25 PM: Attempting ruby version 2.7.2, read from environment
5:41:26 PM: Using ruby version 2.7.2
5:41:27 PM: Using PHP version 8.0
5:41:27 PM: Installing Hugo 0.89.4
5:41:28 PM: hugo v0.89.4-AB01BA6E+extended linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio
5:41:28 PM: Started restoring cached go cache
5:41:28 PM: Finished restoring cached go cache
5:41:28 PM: go version go1.16.5 linux/amd64
5:41:28 PM: go version go1.16.5 linux/amd64
5:41:28 PM: Installing missing commands
5:41:28 PM: Verify run directory
5:41:29 PM: ​
5:41:29 PM: ────────────────────────────────────────────────────────────────
5:41:29 PM: Netlify Build
5:41:29 PM: ────────────────────────────────────────────────────────────────
5:41:29 PM: ​
5:41:29 PM: ❯ Version
5:41:29 PM: @netlify/build 18.24.0
5:41:29 PM: ​
5:41:29 PM: ❯ Flags
5:41:29 PM: baseRelDir: true
5:41:29 PM: buildId: 6196d687354128000846fe36
5:41:29 PM: deployId: 6196d687354128000846fe38
5:41:29 PM: ​
5:41:29 PM: ❯ Current directory
5:41:29 PM: /opt/build/repo
5:41:29 PM: ​
5:41:29 PM: ❯ Config file
5:41:29 PM: /opt/build/repo/netlify.toml
5:41:29 PM: ​
5:41:29 PM: ❯ Context
5:41:29 PM: production
5:41:29 PM: ​
5:41:29 PM: ────────────────────────────────────────────────────────────────
5:41:29 PM: 1. build.command from netlify.toml
5:41:29 PM: ────────────────────────────────────────────────────────────────
5:41:29 PM: ​
5:41:29 PM: $ hugo --gc --minify
5:41:30 PM: Start building sites …
5:41:30 PM: hugo v0.89.4-AB01BA6E+extended linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio
5:41:30 PM: | EN
5:41:30 PM: -------------------±----
5:41:30 PM: Pages | 21
5:41:30 PM: Paginator pages | 0
5:41:30 PM: Non-page files | 0
5:41:30 PM: Static files | 38
5:41:30 PM: Processed images | 0
5:41:30 PM: Aliases | 0
5:41:30 PM: Sitemaps | 1
5:41:30 PM: Cleaned | 0
5:41:30 PM: Total in 92 ms
5:41:30 PM: ​
5:41:30 PM: (build.command completed in 188ms)
5:41:30 PM: ​
5:41:30 PM: ────────────────────────────────────────────────────────────────
5:41:30 PM: 2. Deploy site
5:41:30 PM: ────────────────────────────────────────────────────────────────
5:41:30 PM: ​
5:41:30 PM: Starting to deploy site from ‘public’
5:41:30 PM: Creating deploy tree
5:41:30 PM: Creating deploy upload records
5:41:30 PM: 0 new files to upload
5:41:30 PM: 0 new functions to upload
5:41:30 PM: Site deploy was successfully initiated
5:41:30 PM: ​
5:41:30 PM: (Deploy site completed in 221ms)
5:41:30 PM: ​
5:41:30 PM: ────────────────────────────────────────────────────────────────
5:41:30 PM: Netlify Build Complete
5:41:30 PM: ────────────────────────────────────────────────────────────────
5:41:30 PM: ​
5:41:30 PM: (Netlify Build completed in 518ms)
5:41:30 PM: Starting post processing
5:41:30 PM: Post processing - HTML
5:41:30 PM: Post processing - header rules
5:41:30 PM: Post processing - redirect rules
5:41:30 PM: Caching artifacts
5:41:30 PM: Started saving build plugins
5:41:30 PM: Post processing done
5:41:30 PM: Finished saving build plugins
5:41:30 PM: Started saving pip cache
5:41:30 PM: Finished saving pip cache
5:41:30 PM: Started saving emacs cask dependencies
5:41:30 PM: Finished saving emacs cask dependencies
5:41:30 PM: Started saving maven dependencies
5:41:30 PM: Finished saving maven dependencies
5:41:30 PM: Started saving boot dependencies
5:41:30 PM: Finished saving boot dependencies
5:41:30 PM: Started saving rust rustup cache
5:41:30 PM: Finished saving rust rustup cache
5:41:30 PM: Started saving go dependencies
5:41:30 PM: Finished saving go dependencies
5:41:30 PM: Build script success
5:41:30 PM: Site is live :sparkles:
5:41:49 PM: Finished processing build request in 32.971746679s

Your problem is being caused by building on a system that is not case sensitive then deploying to an environment that is.

Specifically you have these folders with uppercased first letters:

If I run the build as is, I end up with the same result that Netlify does.

However if I rename those folders to be lowercase (podcasts, posts and projects) then the templates are picked up and the build results in the one you’re seeing locally.

2 Likes

@nathanmartin thank you so much. And it was indeed a dumb facepalm moment for me because I adjusted the case of those folders locally knowing it was breaking stuff…but it wasn’t committing that change to the folder name on Github.
I removed the folders temporarily, committed the change, then added them back and recommitted. Now working properly.
Thanks again!

1 Like