Jekyll builds locally but not on Netlify - Errors with PostCSS and JSON

Hey all,

I’m having errors building my jekyll site. I’m getting multiple errors with PostCSS and SyntaxError with JSON, but it works on my local machine.

  • Site: ernestojeh.netlify.app

Build log:
9:08:16 AM: Build ready to start
9:08:17 AM: build-image version: 09c2cdcdf242cf2f57c9ee0fcad9d298fad9ad41
9:08:17 AM: build-image tag: v3.5.0
9:08:17 AM: buildbot version: 8df8a50b1177b0b57364d20e0ea150448924cebf
9:08:18 AM: Fetching cached dependencies
9:08:18 AM: Failed to fetch cache, continuing with build
9:08:18 AM: Starting to prepare the repo for build
9:08:18 AM: No cached dependencies found. Cloning fresh repo
9:08:18 AM: git clone https://github.com/namzo/ernestojeh
9:08:24 AM: Preparing Git Reference refs/heads/beta
9:08:26 AM: Starting build script
9:08:26 AM: Installing dependencies
9:08:26 AM: Python version set to 2.7
9:08:28 AM: v12.18.0 is already installed.
9:08:28 AM: Now using node v12.18.0 (npm v6.14.4)
9:08:28 AM: Started restoring cached build plugins
9:08:28 AM: Finished restoring cached build plugins
9:08:28 AM: Attempting ruby version 2.7.1, read from environment
9:08:30 AM: Using ruby version 2.7.1
9:08:30 AM: Using bundler version 2.1.4 from Gemfile.lock
9:08:30 AM: Using PHP version 5.6
9:08:30 AM: Started restoring cached ruby gems
9:08:30 AM: Finished restoring cached ruby gems
9:08:30 AM: Installing gem bundle
9:08:30 AM: [DEPRECATED] The --path flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use bundle config set path '/opt/build/cache/bundle', and stop using this flag
9:08:31 AM: [DEPRECATED] The --binstubs option will be removed in favor of bundle binstubs
9:08:31 AM: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
9:08:33 AM: Fetching gem metadata from https://rubygems.org/
9:08:33 AM: Fetching public_suffix 4.0.6
9:08:33 AM: Installing public_suffix 4.0.6
9:08:33 AM: Fetching addressable 2.7.0
9:08:33 AM: Installing addressable 2.7.0
9:08:33 AM: Fetching execjs 2.7.0
9:08:34 AM: Installing execjs 2.7.0
9:08:34 AM: Fetching autoprefixer-rails 9.8.6.5
9:08:34 AM: Installing autoprefixer-rails 9.8.6.5
9:08:34 AM: Using bundler 2.1.4
9:08:34 AM: Fetching colorator 1.1.0
9:08:34 AM: Installing colorator 1.1.0
9:08:34 AM: Fetching concurrent-ruby 1.1.7
9:08:34 AM: Installing concurrent-ruby 1.1.7
9:08:34 AM: Fetching eventmachine 1.2.7
9:08:34 AM: Installing eventmachine 1.2.7 with native extensions
9:08:50 AM: Fetching http_parser.rb 0.6.0
9:08:50 AM: Installing http_parser.rb 0.6.0 with native extensions
9:08:51 AM: Fetching em-websocket 0.5.2
9:08:52 AM: Installing em-websocket 0.5.2
9:08:52 AM: Fetching ffi 1.13.1
9:08:52 AM: Installing ffi 1.13.1 with native extensions
9:09:01 AM: Fetching forwardable-extended 2.6.0
9:09:01 AM: Installing forwardable-extended 2.6.0
9:09:01 AM: Fetching i18n 0.9.5
9:09:01 AM: Installing i18n 0.9.5
9:09:01 AM: Fetching rb-fsevent 0.10.4
9:09:01 AM: Installing rb-fsevent 0.10.4
9:09:01 AM: Fetching rb-inotify 0.10.1
9:09:01 AM: Installing rb-inotify 0.10.1
9:09:01 AM: Fetching sass-listen 4.0.0
9:09:01 AM: Installing sass-listen 4.0.0
9:09:01 AM: Fetching sass 3.7.4
9:09:02 AM: Installing sass 3.7.4
9:09:02 AM: Fetching jekyll-sass-converter 1.5.2
9:09:02 AM: Installing jekyll-sass-converter 1.5.2
9:09:02 AM: Fetching listen 3.3.1
9:09:02 AM: Installing listen 3.3.1
9:09:02 AM: Fetching jekyll-watch 2.2.1
9:09:02 AM: Installing jekyll-watch 2.2.1
9:09:02 AM: Fetching rexml 3.2.4
9:09:02 AM: Installing rexml 3.2.4
9:09:02 AM: Fetching kramdown 2.3.0
9:09:02 AM: Installing kramdown 2.3.0
9:09:03 AM: Fetching liquid 4.0.3
9:09:03 AM: Installing liquid 4.0.3
9:09:03 AM: Fetching mercenary 0.3.6
9:09:03 AM: Installing mercenary 0.3.6
9:09:03 AM: Fetching pathutil 0.16.2
9:09:03 AM: Installing pathutil 0.16.2
9:09:03 AM: Fetching rouge 3.25.0
9:09:03 AM: Installing rouge 3.25.0
9:09:04 AM: Fetching safe_yaml 1.0.5
9:09:04 AM: Installing safe_yaml 1.0.5
9:09:04 AM: Fetching jekyll 3.9.0
9:09:04 AM: Installing jekyll 3.9.0
9:09:04 AM: Fetching jekyll-autoprefixer 1.0.2
9:09:04 AM: Installing jekyll-autoprefixer 1.0.2
9:09:04 AM: Fetching jekyll-feed 0.15.1
9:09:04 AM: Installing jekyll-feed 0.15.1
9:09:04 AM: Fetching jekyll-paginate-v2 3.0.0
9:09:04 AM: Installing jekyll-paginate-v2 3.0.0
9:09:04 AM: Fetching jekyll-postcss 0.4.0
9:09:04 AM: Installing jekyll-postcss 0.4.0
9:09:04 AM: Fetching jekyll-purgecss 0.3.0
9:09:04 AM: Installing jekyll-purgecss 0.3.0
9:09:04 AM: Fetching jekyll-redirect-from 0.16.0
9:09:04 AM: Installing jekyll-redirect-from 0.16.0
9:09:04 AM: Fetching jekyll-sitemap 1.4.0
9:09:05 AM: Installing jekyll-sitemap 1.4.0
9:09:05 AM: Fetching kramdown-parser-gfm 1.1.0
9:09:05 AM: Installing kramdown-parser-gfm 1.1.0
9:09:05 AM: Bundle complete! 10 Gemfile dependencies, 36 gems now installed.
9:09:05 AM: Bundled gems are installed into /opt/build/cache/bundle
9:09:05 AM: Post-install message from sass:
9:09:05 AM: Ruby Sass has reached end-of-life and should no longer be used.
9:09:05 AM: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
9:09:05 AM: primary implementation: https://sass-lang.com/install
9:09:05 AM: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
9:09:05 AM: sassc gem: https://github.com/sass/sassc-ruby#readme
9:09:05 AM: * For more details, please refer to the Sass blog:
9:09:05 AM: https://sass-lang.com/blog/posts/7828841
9:09:05 AM: Gem bundle installed
9:09:05 AM: Started restoring cached node modules
9:09:05 AM: Finished restoring cached node modules
9:09:05 AM: Started restoring cached yarn cache
9:09:05 AM: Finished restoring cached yarn cache
9:09:05 AM: Installing yarn at version 1.22.4
9:09:05 AM: Installing Yarn!
9:09:05 AM: > Downloading tarball…
9:09:05 AM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.de1xZjaZnm
9:09:05 AM: % Total % Received % Xferd Average Speed Time Time Time Current
9:09:05 AM: Dload Upload Total Spent Left Speed
9:09:05 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
9:09:05 AM: 100 80 100 80 0 0 263 0 --:–:-- --:–:-- --:–:-- 264
9:09:05 AM: 100 93 100 93 0 0 149 0 --:–:-- --:–:-- --:–:-- 149
9:09:06 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
9:09:06 AM: 100 643 100 643 0 0 709 0 --:–:-- --:–:-- --:–:-- 9318
9:09:06 AM: 100 1215k 100 1215k 0 0 915k 0 0:00:01 0:00:01 --:–:-- 915k
9:09:06 AM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.de1xZjaZnm.asc
9:09:06 AM: 100 84 100 84 0 0 3021 0 --:–:-- --:–:-- --:–:-- 3021
9:09:06 AM: 100 97 100 97 0 0 1760 0 --:–:-- --:–:-- --:–:-- 1760
9:09:06 AM: 100 647 100 647 0 0 7294 0 --:–:-- --:–:-- --:–:-- 7294
9:09:06 AM: 100 1028 100 1028 0 0 8047 0 --:–:-- --:–:-- --:–:-- 8047
9:09:06 AM: > Verifying integrity…
9:09:06 AM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
9:09:06 AM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
9:09:06 AM: gpg: WARNING: This key is not certified with a trusted signature!
9:09:06 AM: gpg: There is no indication that the signature belongs to the owner.
9:09:06 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
9:09:06 AM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
9:09:06 AM: > GPG signature looks good
9:09:06 AM: > Extracting to ~/.yarn…
9:09:06 AM: > Adding to PATH... 9:09:07 AM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available. 9:09:07 AM: Installing NPM modules using Yarn version 1.22.4 9:09:08 AM: yarn install v1.22.4 9:09:08 AM: warning package.json: No license field 9:09:08 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. 9:09:08 AM: warning No license field 9:09:08 AM: [1/4] Resolving packages... 9:09:08 AM: [2/4] Fetching packages... 9:09:14 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module. 9:09:14 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 9:09:14 AM: [3/4] Linking dependencies... 9:09:16 AM: [4/4] Building fresh packages... 9:09:16 AM: Done in 8.46s. 9:09:16 AM: NPM modules installed using Yarn 9:09:17 AM: warning package.json: No license field 9:09:17 AM: Started restoring cached go cache 9:09:17 AM: Finished restoring cached go cache 9:09:17 AM: go version go1.14.4 linux/amd64 9:09:17 AM: go version go1.14.4 linux/amd64 9:09:17 AM: Installing missing commands 9:09:17 AM: Verify run directory 9:09:18 AM: ​ 9:09:18 AM: ──────────────────────────────────────────────────────────────── 9:09:18 AM: Netlify Build 9:09:18 AM: ──────────────────────────────────────────────────────────────── 9:09:18 AM: ​ 9:09:18 AM: ❯ Version 9:09:18 AM: @netlify/build 5.3.3 9:09:18 AM: ​ 9:09:18 AM: ❯ Flags 9:09:18 AM: deployId: 5fbe10f087589a0008e2078d 9:09:18 AM: mode: buildbot 9:09:18 AM: ​ 9:09:18 AM: ❯ Current directory 9:09:18 AM: /opt/build/repo 9:09:18 AM: ​ 9:09:18 AM: ❯ Config file 9:09:18 AM: /opt/build/repo/netlify.toml 9:09:18 AM: ​ 9:09:18 AM: ❯ Context 9:09:18 AM: branch-deploy 9:09:18 AM: ​ 9:09:18 AM: ❯ Loading plugins 9:09:18 AM: - netlify-plugin-minify-html@0.3.0 from netlify.toml and package.json 9:09:19 AM: ​ 9:09:19 AM: ──────────────────────────────────────────────────────────────── 9:09:19 AM: 1. Build command from Netlify app 9:09:19 AM: ──────────────────────────────────────────────────────────────── 9:09:19 AM: ​ 9:09:19 AM: jekyll build
9:09:20 AM: Configuration file: /opt/build/repo/_config.yml
9:09:20 AM: Source: /opt/build/repo
9:09:20 AM: Destination: /opt/build/repo/_site
9:09:20 AM: Incremental build: disabled. Enable with --incremental
9:09:20 AM: Generating…
9:09:20 AM: Jekyll Feed: Generating feed for posts
9:09:20 AM: AutoPages: Disabled/Not configured in site.config.
9:09:20 AM: Pagination: Complete, processed 2 pagination page(s)
9:09:22 AM: undefined:1
9:09:22 AM: {“raw_content”:"@import “tailwindcss/base”;\n@import “tailwindcss/components”;\n@import “_includes/syntax”;\n\n/* Start CSS */\n\nbody, h1, h2, h3, h4, h5, h6, nav, .post-body, .post-excerpt {\n font-family: Monument
9:09:22 AM: SyntaxError: Unexpected end of JSON input
9:09:22 AM: at JSON.parse ()
9:09:22 AM: at Function.process (/opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-postcss-0.4.0/bin/postcss:10:21)
9:09:22 AM: at Object. (/opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-postcss-0.4.0/bin/postcss:45:13)
9:09:22 AM: at Module._compile (internal/modules/cjs/loader.js:1138:30)
9:09:22 AM: at Object.Module._extensions…js (internal/modules/cjs/loader.js:1158:10)
9:09:22 AM: at Module.load (internal/modules/cjs/loader.js:986:32)
9:09:22 AM: at Function.Module._load (internal/modules/cjs/loader.js:879:14)
9:09:22 AM: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
9:09:22 AM: at internal/main/run_main_module.js:17:47
9:09:22 AM: Conversion error: Jekyll::Converters::PostCss encountered an error while converting ‘css/main.css’:
9:09:22 AM: 783: unexpected token at ‘’
9:09:22 AM: jekyll 3.9.0 | Error: 783: unexpected token at ‘’
9:09:22 AM: /opt/buildhome/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/json/common.rb:156:in parse': 783: unexpected token at '' (JSON::ParserError) from /opt/buildhome/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/json/common.rb:156:in parse’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-postcss-0.4.0/lib/jekyll-postcss/socket.rb:43:in decode' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-postcss-0.4.0/lib/jekyll-postcss/socket.rb:32:in read’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-postcss-0.4.0/lib/jekyll/converters/postcss.rb:41:in convert' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:101:in block in convert’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:99:in each' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:99:in reduce’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:99:in convert' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:83:in render_document’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:62:in run' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:479:in render_regenerated’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:472:in block in render_pages' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:471:in each’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:471:in render_pages' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:192:in render’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:71:in process' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in process_site’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in build' from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in process’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:18:in block (2 levels) in init_with_program' from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute’ from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each' from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute’ from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go' from /opt/build/cache/bundle/ruby/2.7.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program’ from /opt/build/cache/bundle/ruby/2.7.0/gems/jekyll-3.9.0/exe/jekyll:15:in <top (required)>' from /opt/build/cache/binstubs/jekyll:29:in load’ from /opt/build/cache/binstubs/jekyll:29:in `'​
9:09:22 AM: ────────────────────────────────────────────────────────────────
9:09:22 AM: “build.command” failed
9:09:22 AM: ────────────────────────────────────────────────────────────────
9:09:22 AM: ​
9:09:22 AM: Error message
9:09:22 AM: Command failed with exit code 1: jekyll build
9:09:22 AM: ​
9:09:22 AM: Error location
9:09:22 AM: In Build command from Netlify app:
9:09:22 AM: jekyll build
9:09:22 AM: ​
9:09:22 AM: Resolved config
9:09:22 AM: build:
9:09:22 AM: command: jekyll build
9:09:22 AM: commandOrigin: ui
9:09:22 AM: environment:
9:09:22 AM: - JEKYLL_ENV
9:09:22 AM: publish: /opt/build/repo/_site
9:09:22 AM: plugins:
9:09:22 AM: - inputs: {}
9:09:22 AM: origin: config
9:09:22 AM: package: netlify-plugin-minify-html
9:09:22 AM: Caching artifacts
9:09:22 AM: Started saving ruby gems
9:09:22 AM: Finished saving ruby gems
9:09:22 AM: Started saving node modules
9:09:22 AM: Finished saving node modules
9:09:22 AM: Started saving build plugins
9:09:22 AM: Finished saving build plugins
9:09:22 AM: Started saving yarn cache
9:09:22 AM: Finished saving yarn cache
9:09:22 AM: Started saving pip cache
9:09:22 AM: Finished saving pip cache
9:09:22 AM: Started saving emacs cask dependencies
9:09:22 AM: Finished saving emacs cask dependencies
9:09:22 AM: Started saving maven dependencies
9:09:22 AM: Finished saving maven dependencies
9:09:22 AM: Started saving boot dependencies
9:09:23 AM: Finished saving boot dependencies
9:09:23 AM: Started saving go dependencies
9:09:23 AM: Finished saving go dependencies
9:09:26 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:09:26 AM: Failing build: Failed to build site
9:09:26 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
9:09:26 AM: Finished processing build request in 1m8.175887203s

Just came back here to say that I fixed this, and it wasn’t a Netlify issue.

I fixed it by swapping all the single quotes in “font-family” for double quotes.

I found the fix here: https://github.com/mhanberg/jekyll-postcss/issues/16

1 Like