Gridsome build fails

Hi there,
I’ve been trying out a gridsome project locally without any issues. It’s basically a fresh installation of the gridsome wordpress starter. When I try deploying to netlify the build fails. I tried to removing the part of my query that causes the failure and any references to it and the build succeeds. What am I doing wrong??

Site is currently at: https://jolly-tesla-9e96a2.netlify.app/
Repo: shorturl.at/iCQRU

    11:44:32 PM: Build ready to start
    11:44:35 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
    11:44:35 PM: build-image tag: v3.4.1
    11:44:35 PM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
    11:44:35 PM: Fetching cached dependencies
    11:44:35 PM: Starting to download cache of 111.7MB
    11:44:35 PM: Finished downloading cache in 641.230633ms
    11:44:35 PM: Starting to extract cache
    11:44:40 PM: Finished extracting cache in 5.185667223s
    11:44:40 PM: Finished fetching cache in 5.859279646s
    11:44:40 PM: Starting to prepare the repo for build
    11:44:41 PM: Preparing Git Reference refs/heads/master
    11:44:43 PM: Starting build script
    11:44:43 PM: Installing dependencies
    11:44:43 PM: Python version set to 2.7
    11:44:43 PM: Started restoring cached node version
    11:44:46 PM: Finished restoring cached node version
    11:44:47 PM: v12.18.0 is already installed.
    11:44:47 PM: Now using node v12.18.0 (npm v6.14.4)
    11:44:47 PM: Started restoring cached build plugins
    11:44:47 PM: Finished restoring cached build plugins
    11:44:47 PM: Attempting ruby version 2.7.1, read from environment
    11:44:49 PM: Using ruby version 2.7.1
    11:44:49 PM: Using PHP version 5.6
    11:44:49 PM: 5.2 is already installed.
    11:44:49 PM: Using Swift version 5.2
    11:44:49 PM: Started restoring cached node modules
    11:44:49 PM: Finished restoring cached node modules
    11:44:49 PM: Started restoring cached yarn cache
    11:44:49 PM: Finished restoring cached yarn cache
    11:44:50 PM: Installing NPM modules using Yarn version 1.22.4
    11:44:50 PM: yarn install v1.22.4
    11:44:51 PM: 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.
    11:44:51 PM: [1/4] Resolving packages...
    11:44:51 PM: success Already up-to-date.
    11:44:51 PM: Done in 0.76s.
    11:44:51 PM: NPM modules installed using Yarn
    11:44:51 PM: Started restoring cached go cache
    11:44:51 PM: Finished restoring cached go cache
    11:44:52 PM: go version go1.14.4 linux/amd64
    11:44:52 PM: go version go1.14.4 linux/amd64
    11:44:52 PM: Installing missing commands
    11:44:52 PM: Verify run directory
    11:44:53 PM: ​
    11:44:53 PM: ┌─────────────────────────────┐
    11:44:53 PM: │        Netlify Build        │
    11:44:53 PM: └─────────────────────────────┘
    11:44:53 PM: ​
    11:44:53 PM: ❯ Version
    11:44:53 PM:   @netlify/build 3.3.0
    11:44:53 PM: ​
    11:44:53 PM: ❯ Flags
    11:44:53 PM:   deployId: 5f421050423a0100073b8b63
    11:44:53 PM:   mode: buildbot
    11:44:53 PM: ​
    11:44:53 PM: ❯ Current directory
    11:44:53 PM:   /opt/build/repo
    11:44:53 PM: ​
    11:44:53 PM: ❯ Config file
    11:44:53 PM:   /opt/build/repo/netlify.toml
    11:44:53 PM: ​
    11:44:53 PM: ❯ Context
    11:44:53 PM:   production
    11:44:53 PM: ​
    11:44:53 PM: ┌────────────────────────────────────┐
    11:44:53 PM: │ 1. build.command from netlify.toml │
    11:44:53 PM: └────────────────────────────────────┘
    11:44:53 PM: ​
    11:44:53 PM: $ gridsome build
    11:44:53 PM: Gridsome v0.7.20
    11:44:54 PM: Initializing plugins...
    11:44:54 PM: Loading data from https://cms.jeremycrowle.com
    11:44:58 PM: Load sources - 3.59s
    11:44:58 PM: Create GraphQL schema - 0.26s
    11:44:58 PM: Create pages and templates - 0.07s
    11:44:58 PM: Generate temporary code - 0.03s
    11:44:58 PM: Bootstrap finish - 4.75s
    11:44:58 PM: Compiling assets...
    11:45:08 PM: Compile assets - 9.68s
    11:45:08 PM: Execute GraphQL (10 queries) - 0.03s
    11:45:08 PM: Could not generate HTML for "/tag/gridsome/":
    11:45:08 PM: TypeError: Cannot read property 'sourceUrl' of undefined
    11:45:08 PM:     at a.render (src/components/Post.vue?2cff:1:89)
    11:45:08 PM:     at a.t._render (/opt/build/repo/node_modules/vue/dist/vue.runtime.common.prod.js:6:35273)
    11:45:08 PM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70575
    11:45:08 PM:     at Yi (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67139)
    11:45:08 PM:     at io (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70551)
    11:45:08 PM:     at ro (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:70182)
    11:45:08 PM:     at _t.eo [as renderNode] (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:67429)
    11:45:08 PM:     at _t.next (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:20445)
    11:45:08 PM:     at n (/opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:18657)
    11:45:08 PM:     at /opt/build/repo/node_modules/vue-server-renderer/build.prod.js:1:68540
    11:45:09 PM: ​
    11:45:09 PM: ┌─────────────────────────────┐
    11:45:09 PM: │   "build.command" failed    │
    11:45:09 PM: └─────────────────────────────┘
    11:45:09 PM: ​
    11:45:09 PM:   Error message
    11:45:09 PM:   Command failed with exit code 1: gridsome build
    11:45:09 PM: ​
    11:45:09 PM:   Error location
    11:45:09 PM:   In build.command from netlify.toml:
    11:45:09 PM:   gridsome build
    11:45:09 PM: ​
    11:45:09 PM:   Resolved config
    11:45:09 PM:   build:
    11:45:09 PM:     command: gridsome build
    11:45:09 PM:     commandOrigin: config
    11:45:09 PM:     environment:
    11:45:09 PM:       - WORDPRESS_URL
    11:45:09 PM:     publish: /opt/build/repo/dist
    11:45:09 PM: Caching artifacts
    11:45:09 PM: Started saving node modules
    11:45:09 PM: Finished saving node modules
    11:45:09 PM: Started saving build plugins
    11:45:09 PM: Finished saving build plugins
    11:45:09 PM: Started saving yarn cache
    11:45:09 PM: Finished saving yarn cache
    11:45:09 PM: Started saving pip cache
    11:45:09 PM: Finished saving pip cache
    11:45:09 PM: Started saving emacs cask dependencies
    11:45:09 PM: Finished saving emacs cask dependencies
    11:45:09 PM: Started saving maven dependencies
    11:45:09 PM: Finished saving maven dependencies
    11:45:09 PM: Started saving boot dependencies
    11:45:09 PM: Finished saving boot dependencies
    11:45:09 PM: Started saving go dependencies
    11:45:09 PM: Finished saving go dependencies
    11:45:09 PM: Error running command: Build script returned non-zero exit code: 1
    11:45:09 PM: Failing build: Failed to build site
    11:45:09 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
    11:45:09 PM: Finished processing build request in 34.474847885s

The query from Index.vue that seems to cause the issue:
(featuredMedia.sourceUrl)

<page-query>
query Home ($page: Int) {
  allWordPressPost (page: $page, perPage: 10) @paginate {
    pageInfo {
      totalPages
      currentPage
    }
    edges {
      node {
        id
        title
        path
        excerpt
        featuredMedia {
          sourceUrl
        }
      }
    }
  }
}
</page-query>

Docker log:

Sign in

laughing_chaplyginnetlify/build:xenial

RUNNING

LogsInspectStats

`Now using node v12.18.0 (npm v6.14.4)`

`Started restoring cached build plugins`

`Finished restoring cached build plugins`

`Attempting ruby version ruby-2.6.3, read from environment`

``

`** WARNING **`

`Using custom ruby version ruby-2.6.3, this will slow down the build.`

`To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.`

`Included versions: 2.6.2 2.7.1`

``

`Required ruby-2.6.3 is not installed - installing.`

`Searching for binary rubies, this might take some time.`

`Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.6.3.tar.bz2`

`Checking requirements for ubuntu.`

`Requirements installation successful.`

`ruby-2.6.3 - #configure`

`ruby-2.6.3 - #download`

`No checksum for downloaded archive, recording checksum in user configuration.`

`ruby-2.6.3 - #validate archive`

`ruby-2.6.3 - #extract`

`ruby-2.6.3 - #validate binary`

`ruby-2.6.3 - #setup`

`ruby-2.6.3 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.3@global`

`ruby-2.6.3 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/.`

`ruby-2.6.3 - #generating global wrappers|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-.`

`ruby-2.6.3 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.3`

`ruby-2.6.3 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list`

`ruby-2.6.3 - #generating default wrappers|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\|.-\|/-\|/-.|/-\|/-\.`

`Using /opt/buildhome/.rvm/gems/ruby-2.6.3`

`Using ruby version 2.6.3`

`Using PHP version 5.6`

`5.2 is already installed.`

`Using Swift version 5.2`

`Started restoring cached node modules`

`Finished restoring cached node modules`

`Installing NPM modules using NPM version 6.14.4`

`[ ..........] / extract:probe-image-size: http fetch GET 200 https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tg`

`https:`

`[ .........] - extract:@babel/helper-annotate-as-pure: http fetch GET 200 https://registry.npmjs.org/to-fast-properties/-/to-fast-pr`

`[ ........] / extract:@babel/types: sill tarball trying picomatch@2.2.2 by hash: sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk5`

`[ .......] / extract:is-wsl: sill extract extend-shallow@2.0.1pmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz 216ms0mm`

`[ ......] \ extract:lokijs: sill extract asynckit@0.4.0egistry.npmjs.org/brorand/-/brorand-1.1.0.tgz 202msatus-codes-3.`

``

`[ ......] | extract:caniuse-lite: sill extract caniuse-lite@1.0.30001117 extracted to /opt/buildhome/repo/node_modules/.staging/cm`

`[ ......] - finalize:lru-cache: sill finalize /opt/buildhome/repo/node_modules/bin-check/node_modules/lru-cachebel/plug`

`..`

`[ ......] | refresh-package-json:errno: sill refresh-package-json /opt/buildhome/repo/node_modules/pifystcss-modules-local`

`[ ......] \ build:core-js: sill linkStuff core-js@3.6.5 has /opt/buildhome/repo/node_modules as itsbuildhome/repo/node_modules asK`

`......] - install:extend-shallow: info lifecycle extend-shallow@2.0.1~install: extend-shallow@2.0.1-minify-gradients@4.0`

`> sharp@0.25.4 install /opt/buildhome/repo/node_modules/sharp`

`> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)`

``

`info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz`

`......] / postinstall:binary-extensions: info lifecycle binary-extensions@1.13.1~postinstall: binary-extensions@1.13.1`

`> core-js@3.6.5 postinstall /opt/buildhome/repo/node_modules/core-js`

`> node -e "try{require('./postinstall')}catch(e){}"`

``

`Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!`

``

`The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:`

`> https://opencollective.com/core-js`

`> https://www.patreon.com/zloirock`

``

`Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)`

``

`......] - postinstall:pumpify: info lifecycle pumpify@1.5.1~postinstall: pumpify@1.5.10Ks-to-string-tag-x@1.4.1`

`> cwebp-bin@5.1.0 postinstall /opt/buildhome/repo/node_modules/cwebp-bin`

`> node lib/install.js`

``

`✔ cwebp pre-build test passed successfully`

``

`> mozjpeg@6.0.1 postinstall /opt/buildhome/repo/node_modules/mozjpeg`

`> node lib/install.js`

``

`✔ mozjpeg pre-build test passed successfully`

``

`> pngquant-bin@5.0.2 postinstall /opt/buildhome/repo/node_modules/pngquant-bin`

`> node lib/install.js`

``

`✔ pngquant pre-build test passed successfully`

`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents):`

`npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})`

`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):`

`npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})`

``

`added 1433 packages from 732 contributors and audited 1438 packages in 41.231s`

``

`45 packages are looking for funding`

`run `npm fund` for details`

``

`found 0 vulnerabilities`

``

`NPM modules installed[90m.....] | prepare:repo: sill install printInstalled`

`Started restoring cached go cache`

`Finished restoring cached go cache`

`go version go1.14.4 linux/amd64`

`go version go1.14.4 linux/amd64`

`Installing missing commands`

`Verify run directory`

`Executing user command: gridsome build`

`Gridsome v0.7.20`

``

`Initializing plugins...`

`Loading data from`

`Error: ECONNREFUSED - wp/v2/types`

`at WordPressSource.fetch (/opt/buildhome/repo/node_modules/@gridsome/source-wordpress/index.js:190:15)`

`at processTicksAndRejections (internal/process/task_queues.js:97:5)`

If anyones having this issue - I just created a blank gridsome project and added @gridsome/source-wordpress and haven’t had any problems.

hi @nesterson - to clarify, does this mean you resolved the issue yourself?

Yes I resolved this on my own - it’s not a netlify problem.
I never found out what was wrong with the default wordpress starter from gridsome - but everything builds now without it

awesome. glad its working!

1 Like