Deploy Preview Failure

I need advice to debug deploy Netlify App

Hi I am trying to use the deploy preview feature of netlify, but it does not seem to want to use the version of hugo that I am using in my production branch, even though the hugo version 0.40.0 is specified in the netlify.toml. The build log shows this entry:
9:55:37 AM: Different build command detected, going to use the one specified in the toml file: 'hugo' versus 'hugo_0.19' in the site
But later down in the code it shows that its trying to use hugo 0.17:
Current theme does not support Hugo version 0.17. Minimum version required is 0.3.
Im seriously confused as to what is happening here. Can someone tell me what is happening? Thank you for your time.

Hi Scott and welcome to our community!

that log line says “we are using plain hugo, since you told us to in the toml file!”

I’d suggest setting this variable:

HUGO_VERSION

to the version you want to use, here:

Then, when you run plain hugo, it will pick up the appropriate version for EVERY build.

This article has a few more details: