I need advice to debug deployment of initial Hugo site from Github to Netlify.
Error while decoding file /opt/build/repo/netlify.toml: Near line 3 (last key parsed ‘build’): expected a top-level item to end with a newline, comment, or EOF, but got ‘[’ instead
Can you paste the contents of your netlify.toml file. I’m somewhat new to netlify but I’ve been using the netlify.toml file without errors.
[build]
publish = “public”
command = “hugo --gc --minify”[context.production.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”
HUGO_ENABLEGITINFO = “true”[context.split1]
command = “hugo --gc --minify --enableGitInfo”[context.split1.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”[context.deploy-preview]
command = “hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL”[context.deploy-preview.environment]
HUGO_VERSION = “0.61.0”[context.branch-deploy]
command = “hugo --gc --minify -b $DEPLOY_PRIME_URL”[context.branch-deploy.environment]
HUGO_VERSION = “0.61.0”[context.next.environment]
HUGO_ENABLEGITINFO = “true”
[build]
publish = “public”
command = “hugo --gc --minify”[context.production.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”
HUGO_ENABLEGITINFO = “true”[context.split1]
command = “hugo --gc --minify --enableGitInfo”[context.split1.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”[context.deploy-preview]
command = “hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL”[context.deploy-preview.environment]
HUGO_VERSION = “0.61.0”[context.branch-deploy]
command = “hugo --gc --minify -b $DEPLOY_PRIME_URL”[context.branch-deploy.environment]
HUGO_VERSION = “0.61.0”[context.next.environment]
HUGO_ENABLEGITINFO = “true”
Thanks in advance,
Max
Hi, @maxmoore, and welcome to our Netlify community site.
This is what I see posted for the netlify.toml file:
[build]
publish = “public”
command = “hugo --gc --minify”[context.production.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”
HUGO_ENABLEGITINFO = “true”[context.split1]
command = “hugo --gc --minify --enableGitInfo”[context.split1.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”[context.deploy-preview]
command = “hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL”[context.deploy-preview.environment]
HUGO_VERSION = “0.61.0”[context.branch-deploy]
command = “hugo --gc --minify -b $DEPLOY_PRIME_URL”[context.branch-deploy.environment]
HUGO_VERSION = “0.61.0”[context.next.environment]
HUGO_ENABLEGITINFO = “true”
This syntax is incorrect above. This might work better:
[build]
publish = “public”
command = “hugo --gc --minify”
[context.production.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”
HUGO_ENABLEGITINFO = “true”
[context.split1]
command = “hugo --gc --minify --enableGitInfo”
[context.split1.environment]
HUGO_VERSION = “0.61.0”
HUGO_ENV = “production”
[context.deploy-preview]
command = “hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL”
[context.deploy-preview.environment]
HUGO_VERSION = “0.61.0”
[context.branch-deploy]
command = “hugo --gc --minify -b $DEPLOY_PRIME_URL”
[context.branch-deploy.environment]
HUGO_VERSION = “0.61.0”
[context.next.environment]
HUGO_ENABLEGITINFO = “true”
Would you be willing to test those changes above (if it still isn’t working)?
Thanks, I used your code but Netlify returned the following error:
6:28:46 PM: Build ready to start
6:28:47 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
6:28:47 PM: build-image tag: v3.3.5
6:28:47 PM: buildbot version: 6067c60f3bc043bb6b9ee9b57c85b10029c65bfd
6:28:48 PM: Fetching cached dependencies
6:28:48 PM: Starting to download cache of 254.9KB
6:28:48 PM: Finished downloading cache in 128.184194ms
6:28:48 PM: Starting to extract cache
6:28:48 PM: Failed to fetch cache, continuing with build
6:28:48 PM: Starting to prepare the repo for build
6:28:48 PM: No cached dependencies found. Cloning fresh repo
6:28:48 PM: git clone https://github.com/maxmooremedia/PortfolioWebsite
6:28:49 PM: Preparing Git Reference refs/heads/master
6:28:50 PM: Found Netlify configuration file netlify.toml in site root
6:28:50 PM: Invalid Netlify configuration file: Error while decoding file /opt/build/repo/netlify.toml: Near line 3 (last key parsed ‘build.publish’): expected value but found ‘“’ instead
6:28:50 PM: Failing build: Failed to parse configuration
6:28:50 PM: failed during stage ‘Reading and parsing configuration files’: Error while decoding file /opt/build/repo/netlify.toml: Near line 3 (last key parsed ‘build.publish’): expected value but found ‘“’ instead
6:28:50 PM: Finished processing build request in 2.582017376s
Any other suggestions,
Thanks heaps for your assistance.
That sounds like an issue of "
vs ”
, possibly? I’d replace any of the curved ones with the straight ones and try it again.