Gatsby Build failed

My website name: Coffee Shop powered by Gatsby.js

I’ve been trying to deploy my project but unfortunately I’ve been facing an error for the past 1 1/2 hour. I googled a bit and I thought I was having the error due to the lack of a netlify.toml file in my root but it wasn’t that. Here’s the log:
Here’s my repo: Coffee Shop

10:56:13 PM: Build ready to start
10:56:15 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
10:56:15 PM: build-image tag: v3.3.20
10:56:15 PM: buildbot version: be8ecf2af866e16fa4301cc5c14de2ccbbb21cf4
10:56:15 PM: Fetching cached dependencies
10:56:15 PM: Starting to download cache of 254.8KB
10:56:15 PM: Finished downloading cache in 79.637924ms
10:56:15 PM: Starting to extract cache
10:56:15 PM: Failed to fetch cache, continuing with build
10:56:15 PM: Starting to prepare the repo for build
10:56:16 PM: No cached dependencies found. Cloning fresh repo
10:56:16 PM: git clone https://github.com/blyatmobilebr/coffee-shop
10:56:16 PM: Preparing Git Reference refs/heads/master
10:56:18 PM: Starting build script
10:56:18 PM: Installing dependencies
10:56:18 PM: Python version set to 2.7
10:56:19 PM: v12.18.0 is already installed.
10:56:20 PM: Now using node v12.18.0 (npm v6.14.4)
10:56:20 PM: Started restoring cached build plugins
10:56:20 PM: Finished restoring cached build plugins
10:56:20 PM: Attempting ruby version 2.7.1, read from environment
10:56:21 PM: Using ruby version 2.7.1
10:56:22 PM: Using PHP version 5.6
10:56:22 PM: 5.2 is already installed.
10:56:22 PM: Using Swift version 5.2
10:56:22 PM: Started restoring cached node modules
10:56:22 PM: Finished restoring cached node modules
10:56:22 PM: Started restoring cached yarn cache
10:56:22 PM: Finished restoring cached yarn cache
10:56:22 PM: Installing yarn at version 1.22.4
10:56:22 PM: Installing Yarn!
10:56:22 PM: > Downloading tarball...
10:56:22 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.OUD7AJBghH
10:56:22 PM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
10:56:22 PM:                                  Dload  Upload   Total   Spent    Left  Speed
10:56:22 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:56:22 PM: 100    80  100    80    0     0    249      0 --:--:-- --:--:-- --:--:--   250
10:56:22 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:56:22 PM: 100    93  100    93    0     0    144      0 --:--:-- --:--:-- --:--:--   357
10:56:23 PM: 100   630  100   630    0     0    695      0 --:--:-- --:--:-- --:--:--   695
10:56:23 PM: 100 1215k  100 1215k    0     0   898k      0  0:00:01  0:00:01 --:--:--  898k
10:56:23 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.OUD7AJBghH.asc
10:56:23 PM:   0    84    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:56:23 PM: 100    84  100    84    0     0   3042      0 --:--:-- --:--:-- --:--:-- 84000
10:56:23 PM: 100    97  100    97    0     0   1735      0 --:--:-- --:--:-- --:--:--  1735
10:56:23 PM: 100   634  100   634    0     0   7107      0 --:--:-- --:--:-- --:--:--  7107
10:56:23 PM: 100  1028  100  1028    0     0   7949      0 --:--:-- --:--:-- --:--:--  7949
10:56:23 PM: > Verifying integrity...
10:56:23 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
10:56:23 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
10:56:23 PM: gpg: WARNING: This key is not certified with a trusted signature!
10:56:23 PM: gpg:          There is no indication that the signature belongs to the owner.
10:56:23 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
10:56:23 PM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
10:56:23 PM: > GPG signature looks good
10:56:23 PM: > Extracting to ~/.yarn...
10:56:23 PM: > Adding to $PATH...
10:56:24 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.
10:56:24 PM: Installing NPM modules using Yarn version 1.22.4
10:56:25 PM: yarn install v1.22.4
10:56:25 PM: [1/4] Resolving packages...
10:56:26 PM: [2/4] Fetching packages...
10:56:33 PM: warning url-loader@1.1.2: Invalid bin field for "url-loader".
10:57:23 PM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
10:57:23 PM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
10:57:23 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
10:57:23 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
10:57:23 PM: [3/4] Linking dependencies...
10:57:23 PM: warning "gatsby > @pmmmwh/react-refresh-webpack-plugin@0.3.3" has incorrect peer dependency "react-refresh@^0.8.2".
10:57:23 PM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
10:57:40 PM: [4/4] Building fresh packages...
10:57:45 PM: Done in 80.19s.
10:57:45 PM: NPM modules installed using Yarn
10:57:45 PM: Started restoring cached go cache
10:57:45 PM: Finished restoring cached go cache
10:57:45 PM: go version go1.14.4 linux/amd64
10:57:45 PM: go version go1.14.4 linux/amd64
10:57:45 PM: Installing missing commands
10:57:45 PM: Verify run directory
10:57:46 PM: ​
10:57:46 PM: ┌─────────────────────────────┐
10:57:46 PM: │        Netlify Build        │
10:57:46 PM: └─────────────────────────────┘
10:57:46 PM: ​
10:57:46 PM: ❯ Version
10:57:46 PM:   @netlify/build 3.0.1
10:57:46 PM: ​
10:57:46 PM: ❯ Flags
10:57:46 PM:   deployId: 5f276ebdb4b5b7ab6cf8d430
10:57:46 PM:   mode: buildbot
10:57:46 PM: ​
10:57:46 PM: ❯ Current directory
10:57:46 PM:   /opt/build/repo
10:57:46 PM: ​
10:57:46 PM: ❯ Config file
10:57:46 PM:   /opt/build/repo/netlify.toml
10:57:46 PM: ​
10:57:46 PM: ❯ Context
10:57:46 PM:   production
10:57:46 PM: ​
10:57:46 PM: ┌────────────────────────────────────┐
10:57:46 PM: │ 1. build.command from netlify.toml │
10:57:46 PM: └────────────────────────────────────┘
10:57:46 PM: ​
10:57:46 PM: $ gatsby build
10:57:50 PM: success open and validate gatsby-configs - 0.018s
10:57:50 PM: success load plugins - 0.661s
10:57:50 PM: error "gatsby-plugin-manifest" threw an error while running the onPreInit lifecycle:
10:57:50 PM: ENOENT: no such file or directory, open 'src/images/logo.png'
10:57:50 PM:   135 | 
10:57:50 PM:   136 |   if (pluginOptions.cache_busting_mode !== "none" && pluginOptions.icon) {
10:57:50 PM: > 137 |     pluginOptions.cacheDigest = (0, _gatsbyCoreUtils.createContentDigest)(fs.readFileSync(pluginOptions.icon));
10:57:50 PM:       |                                                                              ^
10:57:50 PM:   138 |   }
10:57:50 PM:   139 | };
10:57:50 PM:   140 | 
10:57:50 PM: 
10:57:50 PM: 
10:57:50 PM:   Error: ENOENT: no such file or directory, open 'src/images/logo.png'
10:57:50 PM:   
10:57:50 PM:   - gatsby-node.js:137 Object.exports.onPreInit
10:57:50 PM:     [repo]/[gatsby-plugin-manifest]/gatsby-node.js:137:78
10:57:50 PM:   
10:57:50 PM:   - api-runner-node.js:259 runAPI
10:57:50 PM:     [repo]/[gatsby]/dist/utils/api-runner-node.js:259:37
10:57:50 PM:   
10:57:50 PM:   - api-runner-node.js:378 Promise.catch.decorateEvent.pluginName
10:57:50 PM:     [repo]/[gatsby]/dist/utils/api-runner-node.js:378:15
10:57:50 PM:   
10:57:50 PM:   - debuggability.js:384 Promise._execute
10:57:50 PM:     [repo]/[bluebird]/js/release/debuggability.js:384:9
10:57:50 PM:   
10:57:50 PM:   - promise.js:518 Promise._resolveFromExecutor
10:57:50 PM:     [repo]/[bluebird]/js/release/promise.js:518:18
10:57:50 PM:   
10:57:50 PM:   - promise.js:103 new Promise
10:57:50 PM:     [repo]/[bluebird]/js/release/promise.js:103:10
10:57:50 PM:   
10:57:50 PM:   - api-runner-node.js:377 
10:57:50 PM:     [repo]/[gatsby]/dist/utils/api-runner-node.js:377:12
10:57:50 PM:   
10:57:50 PM:   - util.js:16 tryCatcher
10:57:50 PM:     [repo]/[bluebird]/js/release/util.js:16:23
10:57:50 PM:   
10:57:50 PM:   - reduce.js:166 Object.gotValue
10:57:50 PM:     [repo]/[bluebird]/js/release/reduce.js:166:18
10:57:50 PM:   
10:57:50 PM:   - reduce.js:155 Object.gotAccum
10:57:50 PM:     [repo]/[bluebird]/js/release/reduce.js:155:25
10:57:50 PM:   
10:57:50 PM:   - util.js:16 Object.tryCatcher
10:57:50 PM:     [repo]/[bluebird]/js/release/util.js:16:23
10:57:50 PM:   
10:57:50 PM:   - promise.js:547 Promise._settlePromiseFromHandler
10:57:50 PM:     [repo]/[bluebird]/js/release/promise.js:547:31
10:57:50 PM:   
10:57:50 PM:   - promise.js:604 Promise._settlePromise
10:57:50 PM:     [repo]/[bluebird]/js/release/promise.js:604:18
10:57:50 PM:   
10:57:50 PM:   - promise.js:641 Promise._settlePromiseCtx
10:57:50 PM:     [repo]/[bluebird]/js/release/promise.js:641:10
10:57:50 PM:   
10:57:50 PM: 
10:57:50 PM: not finished onPreInit - 0.071s
10:57:51 PM: ​
10:57:51 PM: ┌─────────────────────────────┐
10:57:51 PM: │   "build.command" failed    │
10:57:51 PM: └─────────────────────────────┘
10:57:51 PM: ​
10:57:51 PM:   Error message
10:57:51 PM:   Command failed with exit code 1: gatsby build
10:57:51 PM: ​
10:57:51 PM:   Error location
10:57:51 PM:   In build.command from netlify.toml:
10:57:51 PM:   gatsby build
10:57:51 PM: ​
10:57:51 PM:   Resolved config
10:57:51 PM:   build:
10:57:51 PM:     command: gatsby build
10:57:51 PM:     commandOrigin: config
10:57:51 PM:     publish: /opt/build/repo/public
10:57:51 PM: Caching artifacts
10:57:51 PM: Started saving node modules
10:57:51 PM: Finished saving node modules
10:57:51 PM: Started saving build plugins
10:57:51 PM: Finished saving build plugins
10:57:51 PM: Started saving yarn cache
10:57:51 PM: Finished saving yarn cache
10:57:51 PM: Started saving pip cache
10:57:51 PM: Finished saving pip cache
10:57:51 PM: Started saving emacs cask dependencies
10:57:51 PM: Finished saving emacs cask dependencies
10:57:51 PM: Started saving maven dependencies
10:57:51 PM: Finished saving maven dependencies
10:57:51 PM: Started saving boot dependencies
10:57:51 PM: Finished saving boot dependencies
10:57:51 PM: Started saving go dependencies
10:57:51 PM: Finished saving go dependencies
10:57:54 PM: Error running command: Build script returned non-zero exit code: 1
10:57:54 PM: Failing build: Failed to build site
10:57:54 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
10:57:54 PM: Finished processing build request in 1m39.487167609s

netlify.toml file:

    [build]
      command = "gatsby build"
      publish = "public"

    [dev]
      command = "gatsby develop"

howdy!

looks like you are super close to getting a working build, actually, but for some reason we are getting stuck here:

10:57:50 PM: error "gatsby-plugin-manifest" threw an error while running the onPreInit lifecycle:
10:57:50 PM: ENOENT: no such file or directory, open 'src/images/logo.png'
10:57:50 PM:   135 | 
10:57:50 PM:   136 |   if (pluginOptions.cache_busting_mode !== "none" && pluginOptions.icon) {
10:57:50 PM: > 137 |     pluginOptions.cacheDigest = (0, _gatsbyCoreUtils.createContentDigest)(fs.readFileSync(pluginOptions.icon));
10:57:50 PM:       |                                                                              ^
10:57:50 PM:   138 |   }
10:57:50 PM:   139 | };
10:57:50 PM:   140 | 

this file seems to not be available under the name or at the path that you are specifying.

Does this build locally? if yes, then it may be a case issue:

Can you give this a read through and let us know if that fixes the issue?

1 Like

Hello there, I hope you’re doing well! Thank you for the explanation but the error was deadly simple: I used the wrong extension in that icon, instead of .png it’s .svg. A funny mistake but thankfully I was able to fix that! Thank you :slight_smile:

1 Like