Day night mode fails to show on my page

Dear All,
Earlier, I had the day/night toggle button on my page with auto selection. But it has now disappeared and the permanent dark mode option does not work. I also have the following warning from the buildlog:
WARN 2022/02/01 17:42:32 Module “github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5” is not compatible with this Hugo version; run “hugo mod graph” for more information.

Everytthing else looks okay. Below are my site details: Please can you help.
Thank you very much in advance.

Best wishes, Sujit

Sitename:

baseurl: https://www.sujitsahu.com

file: params.yaml

Appearance

theme: minimal
day_night: true
font: ‘’
font_size: L

Hi there, @sujit-sahu :wave:

Thanks for reaching out! We just need a bit more information to help you further. Did you make any code changes between the time when it was working and when it stopped working? Can you share a full copy of your deploy log as well as your project repo?

If this is a code specific error we will not be able to debug it with you as it is outside of our Scope of Support. However, if this is a bug or a product not working as expected then we are happy to look into it further!

1 Like

Sorry, please ignore my earlier reply.

I can see your reply now. Yes, I have edited the site recently after deployoment in September! The cinfiguration and the Hugo version numbers are bit mixed up. Here is the relevant part of the deploy log. I understand the limitation in the scope of the support, but any help will be greatly appreciated.
Best wishes, Sujit

5:41:44 PM: Build ready to start
5:41:46 PM: build-image version: c97e5a221e3fdb93dfecc4e878977417130d2bfc (xenial)
5:41:46 PM: build-image tag: v3.10.4
5:41:46 PM: buildbot version: 94cf4881e10a7b2d529971a176d6ede22bcaeb38
5:41:46 PM: Fetching cached dependencies
5:41:46 PM: Starting to download cache of 686.5MB
5:41:50 PM: Finished downloading cache in 4.172746579s
5:41:50 PM: Starting to extract cache
5:42:00 PM: Finished extracting cache in 9.84639192s
5:42:00 PM: Finished fetching cache in 14.168301771s
5:42:00 PM: Starting to prepare the repo for build
5:42:01 PM: Preparing Git Reference refs/heads/master
5:42:20 PM: Parsing package.json dependencies
5:42:20 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘public’ versus ‘/’ in the Netlify UI
5:42:20 PM: Different build command detected, going to use the one specified in the Netlify configuration file: ‘hugo --gc --minify -b $URL’ versus ‘’ in the Netlify UI
5:42:20 PM: Starting build script
5:42:21 PM: Installing dependencies
5:42:21 PM: Python version set to 2.7
5:42:21 PM: Started restoring cached node version
5:42:24 PM: Finished restoring cached node version
5:42:25 PM: v12.18.0 is already installed.
5:42:25 PM: Now using node v12.18.0 (npm v6.14.4)
5:42:25 PM: Started restoring cached build plugins
5:42:25 PM: Finished restoring cached build plugins
5:42:26 PM: Attempting ruby version 2.7.2, read from environment
5:42:27 PM: Using ruby version 2.7.2
5:42:28 PM: Using PHP version 5.6
5:42:28 PM: Installing Hugo 0.84.4
5:42:28 PM: hugo v0.84.4-020E4ACE+extended linux/amd64 BuildDate=2021-07-01T11:51:55Z VendorInfo=gohugoio
5:42:28 PM: Started restoring cached go cache
5:42:28 PM: Finished restoring cached go cache
5:42:28 PM: go version go1.14.4 linux/amd64
5:42:28 PM: go version go1.14.4 linux/amd64
5:42:28 PM: Installing missing commands
5:42:28 PM: Verify run directory
5:42:29 PM: ​
5:42:29 PM: ────────────────────────────────────────────────────────────────
5:42:29 PM: Netlify Build
5:42:29 PM: ────────────────────────────────────────────────────────────────
5:42:29 PM: ​
5:42:29 PM: ❯ Version
5:42:29 PM: @netlify/build 26.2.2
5:42:29 PM: ​
5:42:29 PM: ❯ Flags
5:42:29 PM: baseRelDir: true
5:42:29 PM: buildId: 61f970d8e04e420008937fed
5:42:29 PM: deployId: 61f970d8e04e420008937fef
5:42:29 PM: ​
5:42:29 PM: ❯ Current directory
5:42:29 PM: /opt/build/repo
5:42:29 PM: ​
5:42:29 PM: ❯ Config file
5:42:29 PM: /opt/build/repo/netlify.toml
5:42:29 PM: ​
5:42:29 PM: ❯ Context
5:42:29 PM: production
5:42:30 PM: ​
5:42:30 PM: ❯ Loading plugins
5:42:30 PM: - netlify-plugin-hugo-cache-resources@0.2.1 from netlify.toml
5:42:31 PM: ​
5:42:31 PM: ────────────────────────────────────────────────────────────────
5:42:31 PM: 1. netlify-plugin-hugo-cache-resources (onPreBuild event)
5:42:31 PM: ────────────────────────────────────────────────────────────────
5:42:31 PM: ​
5:42:32 PM: Checking if resources exist at “resources”
5:42:32 PM: Restored cached resources folder. Total files: 2
5:42:32 PM: —
5:42:32 PM: 1. /opt/build/repo/resources
5:42:32 PM: 2. /opt/build/repo/resources/_gen
5:42:32 PM: ​
5:42:32 PM: (netlify-plugin-hugo-cache-resources onPreBuild completed in 349ms)
5:42:32 PM: ​
5:42:32 PM: ────────────────────────────────────────────────────────────────
5:42:32 PM: 2. build.command from netlify.toml
5:42:32 PM: ────────────────────────────────────────────────────────────────
5:42:32 PM: ​
5:42:32 PM: $ hugo --gc --minify -b $URL
5:42:32 PM: WARN 2022/02/01 17:42:32 Module “github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5” is not compatible with this Hugo version; run “hugo mod graph” for more information.
5:42:32 PM: Start building sites …
5:42:32 PM: hugo v0.84.4-020E4ACE+extended linux/amd64 BuildDate=2021-07-01T11:51:55Z VendorInfo=gohugoio
5:42:33 PM: | EN
5:42:33 PM: -------------------±-----
5:42:33 PM: Pages | 70
5:42:33 PM: Paginator pages | 0
5:42:33 PM: Non-page files | 25
5:42:33 PM: Static files | 210
5:42:33 PM: Processed images | 237
5:42:33 PM: Aliases | 10
5:42:33 PM: Sitemaps | 1
5:42:33 PM: Cleaned | 0
5:42:33 PM: Total in 1442 ms
5:42:33 PM: ​
5:42:33 PM: (build.command completed in 1.5s)

From what I see @sujit-sahu, the <body> has the class dark (regardless of system setting.) When removed the page turns to the light theme. I see no mechanism to switch this on the page.

Many thanks @coelmay Please can you tell me which configuration file I edit to make it light theme permanently? I searched for “dark” and “body” in the config.yaml and params.yaml but could not find anything. I would like to make it light theme if I cannot switch between the two modes.
Best wishes, Sujit

One possibility is in params.yaml

day_night: true

and the other possibility is in config.yaml

  # Let the user override the default light/dark mode of your theme?
  show_day_night: true

According to home/content/post/getting-started/index.md and the demo it links to, a theme switch is visible in the top-right of the navigation. This is not the case with your site though. Exactly why this is the case I do not know.

Dear @coelmay Many thanks. I have tried those several times. But I think something is wrong with my site. I am getting these error messages on my Computer terminal when I refresh the site locally.
“User theming disabled.”
“Environment: development”
“Navbar height: 50”
“User theming disabled.”
“Setting HLJS theme to dark”

Do you think its a version mismatch somewhere?

Best wishes, Sujit

Given the following line from the deploy log you shared, quite possible

1 Like

Thanks. I solved it finally. Downloaded the template again and used the distributed theme.toml from the fresh template download. That brought me back the day/light mode. It is visible now:

Many thanks to @coelmay for your contunued help!

2 Likes

So glad this is working now. Thanks for some great support, @coelmay!

Happy building :netliconfetti: