# Error while decoding file /opt/build/repo/netlify.toml

**URL:** <https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628>\
**Category:** Support\
**Tags:** deployment\
**Created:** [January 19, 2020, 5:15am UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628 "2020-01-19T05:15:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxmoore](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/maxmoore/32/5880_2.png) [@maxmoore](https://answers.netlify.com/u/maxmoore)\
**Post date:** [January 19, 2020, 5:15am UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/1 "2020-01-19T05:15:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ntoporcov](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ntoporcov/32/5870_2.png) [@ntoporcov](https://answers.netlify.com/u/ntoporcov)\
**Post date:** [January 20, 2020, 1:04pm UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/2 "2020-01-20T13:04:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![maxmoore](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/maxmoore/32/5880_2.png) [@maxmoore](https://answers.netlify.com/u/maxmoore)\
**Post date:** [January 20, 2020, 9:41pm UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/3 "2020-01-20T21:41:15Z")

</div>

[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”

---

<div class="post-metadata">

**Author:** ![maxmoore](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/maxmoore/32/5880_2.png) [@maxmoore](https://answers.netlify.com/u/maxmoore)\
**Post date:** [January 20, 2020, 9:35pm UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/4 "2020-01-20T21:35:22Z")

</div>

[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

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [January 21, 2020, 5:49am UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/5 "2020-01-21T05:49:57Z")

</div>

Hi, @maxmoore, and welcome to our Netlify community site.

This is what I see posted for the netlify.toml file:

```auto
[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:

```auto
[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)?

---

<div class="post-metadata">

**Author:** ![maxmoore](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/maxmoore/32/5880_2.png) [@maxmoore](https://answers.netlify.com/u/maxmoore)\
**Post date:** [January 21, 2020, 7:33am UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/6 "2020-01-21T07:33:02Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [January 21, 2020, 11:03pm UTC](https://answers.netlify.com/t/error-while-decoding-file-opt-build-repo-netlify-toml/7628/7 "2020-01-21T23:03:48Z")

</div>

That sounds like an issue of `"` vs `”`, possibly? I’d replace any of the curved ones with the straight ones and try it again.
