gatsbyjs / gatsby-source-wordpress-experimental

The upcoming v4 of gatsby-source-wordpress, currently in beta
MIT License
385 stars 100 forks source link

Error fetching MediaItem when deploying on Netlify | [object Object] Input file contains unsupported image format #333

Closed SRFeesha closed 3 years ago

SRFeesha commented 3 years ago

Overview

I'm trying to deploy my website on Netlify. It source data from wordpress via graphql with gatsby source wordpress v4. Here is the website where i take data from.

I can build site locally, can deploy it manually on netlify with netlify deploy --prod , but can't build when triggering from CI/CD

image

The error i get is:

error [object Object] Input file contains unsupported image format Error: Input file contains unsupported image format

I need advice to debug deploy https://app.netlify.com/sites/wonderful-kepler-5e8164/deploys/5fc627aed1f92d000856d4e9

Steps to reproduce

  1. Clone this Github repo
  2. npm install
  3. Deploy to netlify

What I've tried

I've already tried the most common fixes found online but can't really fix it:

12:31:33 PM: Build ready to start
12:31:34 PM: build-image version: 09c2cdcdf242cf2f57c9ee0fcad9d298fad9ad41
12:31:34 PM: build-image tag: v3.5.0
12:31:34 PM: buildbot version: 8df8a50b1177b0b57364d20e0ea150448924cebf
12:31:34 PM: Fetching cached dependencies
12:31:34 PM: Failed to fetch cache, continuing with build
12:31:34 PM: Starting to prepare the repo for build
12:31:35 PM: No cached dependencies found. Cloning fresh repo
12:31:35 PM: git clone [https://github.com/SRFeesha/wonder-website](https://github.com/SRFeesha/wonder-website)
12:31:36 PM: Preparing Git Reference refs/heads/master
12:31:37 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
12:31:37 PM: Starting build script
12:31:37 PM: Installing dependencies
12:31:37 PM: Python version set to 2.7
12:31:39 PM: v12.18.0 is already installed.
12:31:39 PM: Now using node v12.18.0 (npm v6.14.4)
12:31:39 PM: Started restoring cached build plugins
12:31:39 PM: Finished restoring cached build plugins
12:31:39 PM: Attempting ruby version 2.7.1, read from environment
12:31:41 PM: Using ruby version 2.7.1
12:31:41 PM: Using PHP version 5.6
12:31:41 PM: Started restoring cached node modules
12:31:41 PM: Finished restoring cached node modules
12:31:41 PM: Installing NPM modules using NPM version 6.14.4
12:32:29 PM: > yarn@1.22.10 preinstall /opt/build/repo/node_modules/yarn
12:32:29 PM: > :; (node ./preinstall.js > /dev/null 2>&1 || true)
12:32:33 PM: > bufferutil@4.0.2 install /opt/build/repo/node_modules/bufferutil
12:32:33 PM: > node-gyp-build
12:32:33 PM: > utf-8-validate@5.0.3 install /opt/build/repo/node_modules/utf-8-validate
12:32:33 PM: > node-gyp-build
12:32:34 PM: > sharp@0.25.4 install /opt/build/repo/node_modules/gatsby-transformer-sharp/node_modules/sharp
12:32:34 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
12:32:35 PM: info sharp Downloading [https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz](https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz)
12:32:36 PM: > sharp@0.26.3 install /opt/build/repo/node_modules/sharp
12:32:36 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
12:32:37 PM: info sharp Downloading [https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linux-x64.tar.br](https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linux-x64.tar.br)
12:32:40 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
12:32:40 PM: > node -e "try{require('./postinstall')}catch(e){}"
12:32:40 PM: > core-js@3.8.0 postinstall /opt/build/repo/node_modules/core-js
12:32:40 PM: > node -e "try{require('./postinstall')}catch(e){}"
12:32:40 PM: > core-js-pure@3.8.0 postinstall /opt/build/repo/node_modules/core-js-pure
12:32:40 PM: > node -e "try{require('./postinstall')}catch(e){}"
12:32:42 PM: > gatsby-telemetry@1.5.1 postinstall /opt/build/repo/node_modules/gatsby-telemetry
12:32:42 PM: > node src/postinstall.js || true
12:32:42 PM: > mozjpeg@7.0.0 postinstall /opt/build/repo/node_modules/mozjpeg
12:32:42 PM: > node lib/install.js
12:32:42 PM:   ✔ mozjpeg pre-build test passed successfully
12:32:42 PM: > pngquant-bin@6.0.0 postinstall /opt/build/repo/node_modules/pngquant-bin
12:32:42 PM: > node lib/install.js
12:32:42 PM:   ✔ pngquant pre-build test passed successfully
12:32:43 PM: > gatsby-cli@2.14.1 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
12:32:43 PM: > node scripts/postinstall.js
12:32:43 PM: > gatsby@2.27.5 postinstall /opt/build/repo/node_modules/gatsby
12:32:43 PM: > node scripts/postinstall.js
12:32:46 PM: npm WARN wonderflow-website-gatsby@0.0.1 No repository field.
12:32:46 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
12:32:46 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
12:32:46 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
12:32:46 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
12:32:46 PM: added 2805 packages from 1338 contributors and audited 2819 packages in 63.715s
12:32:48 PM: 165 packages are looking for funding
12:32:48 PM:   run `npm fund` for details
12:32:48 PM: found 0 vulnerabilities
12:32:49 PM: NPM modules installed
12:32:49 PM: Started restoring cached go cache
12:32:49 PM: Finished restoring cached go cache
12:32:49 PM: go version go1.14.4 linux/amd64
12:32:49 PM: go version go1.14.4 linux/amd64
12:32:49 PM: Installing missing commands
12:32:49 PM: Verify run directory
12:32:51 PM: 
12:32:51 PM: ────────────────────────────────────────────────────────────────
12:32:51 PM:   Netlify Build
12:32:51 PM: ────────────────────────────────────────────────────────────────
12:32:51 PM: 
12:32:51 PM: ❯ Version
12:32:51 PM:   @netlify/build 5.3.3
12:32:51 PM: 
12:32:51 PM: ❯ Flags
12:32:51 PM:   deployId: 5fc6299428024c00086c2952
12:32:51 PM:   mode: buildbot
12:32:51 PM: 
12:32:51 PM: ❯ Current directory
12:32:51 PM:   /opt/build/repo
12:32:51 PM: 
12:32:51 PM: ❯ Config file
12:32:51 PM:   No config file was defined: using default values.
12:32:51 PM: 
12:32:51 PM: ❯ Context
12:32:51 PM:   production
12:32:51 PM: 
12:32:51 PM: ────────────────────────────────────────────────────────────────
12:32:51 PM:   1. Build command from Netlify app
12:32:51 PM: ────────────────────────────────────────────────────────────────
12:32:51 PM: 
12:32:51 PM: $ npm run build
12:32:51 PM: > wonderflow-website-gatsby@0.0.1 build /opt/build/repo
12:32:51 PM: > gatsby build
12:32:54 PM: success open and validate gatsby-configs - 0.037s
12:32:55 PM: success load plugins - 0.866s
12:32:55 PM: success onPreInit - 0.105s
12:32:55 PM: success delete html and css files from previous builds - 0.003s
12:32:55 PM: success initialize cache - 0.008s
12:32:55 PM: success copy gatsby files - 0.032s
12:32:55 PM: success onPreBootstrap - 0.014s
12:32:58 PM: ⠀
12:32:58 PM: info  gatsby-source-wordpress
12:32:58 PM:    This is either your first build or the cache was cleared.
12:32:58 PM:    Please wait while your WordPress data is synced to your Gatsby cache.
12:32:58 PM:    Maybe now's a good time to get up and stretch? :D
12:33:00 PM: success  gatsby-source-wordpress  writing GraphQL queries to disk at ./WordPress/GraphQL/ - 0.300s
12:33:00 PM: success  gatsby-source-wordpress  ingest WPGraphQL schema - 2.800s
12:33:00 PM: success createSchemaCustomization - 4.786s
12:33:01 PM: success  gatsby-source-wordpress  fetch root fields - 1.230s
12:33:01 PM: success  gatsby-source-wordpress  Comment - 1.232s - fetched 0
12:33:02 PM: success  gatsby-source-wordpress  Menu - 1.644s - fetched 3
12:33:02 PM: success  gatsby-source-wordpress  UserRole - 1.766s - fetched 0
12:33:02 PM: success  gatsby-source-wordpress  PostFormat - 2.266s - fetched 4
12:33:02 PM: success  gatsby-source-wordpress  Taxonomy - 2.428s - fetched 3
12:33:02 PM: success  gatsby-source-wordpress  MenuItem - 2.597s - fetched 18
12:33:03 PM: success  gatsby-source-wordpress  Tag - 3.548s - fetched 161
12:33:05 PM: success  gatsby-source-wordpress  ContentType - 5.128s - fetched 3
12:33:05 PM: success  gatsby-source-wordpress  Category - 5.192s - fetched 20
12:33:05 PM: success  gatsby-source-wordpress  User - 5.253s - fetched 8
12:33:08 PM: success  gatsby-source-wordpress  Post - 8.172s - fetched 100
12:33:12 PM: success  gatsby-source-wordpress  Page - 11.643s - fetched 92
12:33:15 PM: error [object Object] Input file contains unsupported image format
12:33:15 PM:
12:33:15 PM:
12:33:15 PM:   Error: Input file contains unsupported image format
12:33:15 PM:
12:33:15 PM: not finished source and transform nodes - 15.346s
12:33:15 PM: not finished  gatsby-source-wordpress  fetching nodes - 15.279s - 428 total
12:33:15 PM: not finished  gatsby-source-wordpress  creating nodes - 3.631s
12:33:15 PM: not finished  gatsby-source-wordpress  MediaItem - 3.631s - fetched 16
12:33:15 PM: not finished Downloading remote files - 1.252s
12:33:15 PM: npm ERR! code ELIFECYCLE
12:33:15 PM: npm ERR! errno 1
12:33:15 PM: npm ERR! wonderflow-website-gatsby@0.0.1 build: `gatsby build`
12:33:15 PM: npm ERR! Exit status 1
12:33:15 PM: npm ERR!
12:33:15 PM: npm ERR! Failed at the wonderflow-website-gatsby@0.0.1 build script.
12:33:15 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
12:33:15 PM: npm ERR! A complete log of this run can be found in:
12:33:15 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-12-01T11_33_15_718Z-debug.log
12:33:15 PM: 
12:33:15 PM: ────────────────────────────────────────────────────────────────
12:33:15 PM:   "build.command" failed
12:33:15 PM: ────────────────────────────────────────────────────────────────
12:33:15 PM: 
12:33:15 PM:   Error message
12:33:15 PM:   Command failed with exit code 1: npm run build
12:33:15 PM: 
12:33:15 PM:   Error location
12:33:15 PM:   In Build command from Netlify app:
12:33:15 PM:   npm run build
12:33:15 PM: 
12:33:15 PM:   Resolved config
12:33:15 PM:   build:
12:33:15 PM:     command: npm run build
12:33:15 PM:     commandOrigin: ui
12:33:15 PM:     publish: /opt/build/repo/public
12:33:15 PM: Caching artifacts
12:33:15 PM: Started saving node modules
12:33:15 PM: Finished saving node modules
12:33:15 PM: Started saving build plugins
12:33:15 PM: Finished saving build plugins
12:33:15 PM: Started saving pip cache
12:33:16 PM: Finished saving pip cache
12:33:16 PM: Started saving emacs cask dependencies
12:33:16 PM: Finished saving emacs cask dependencies
12:33:16 PM: Started saving maven dependencies
12:33:16 PM: Finished saving maven dependencies
12:33:16 PM: Started saving boot dependencies
12:33:16 PM: Finished saving boot dependencies
12:33:16 PM: Started saving go dependencies
12:33:16 PM: Finished saving go dependencies
12:33:19 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:33:19 PM: Failing build: Failed to build site
12:33:19 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
12:33:19 PM: Finished processing build request in 1m44.415519239s

gatsby.config

require('dotenv').config({
  path: `.env.GATSBY_CONCURRENT_DOWNLOAD`,
  source: `.env.GATSBY_SOURCE_URL`
})

// require .env.development or .env.production
require('dotenv').config({
  path: `.env.${process.env.NODE_ENV}`
})

module.exports = {
  siteMetadata: {
    title: 'Wonderflow - Simple Customer Feedback Analytics, based on AI',
    description:
      'Are you struggling to analyze your customer feedback from different sources and languages? Wonderflow helps you to become customer-centric.',
    siteUrl: 'https://www.staging-website.wonderflow.ai', // No trailing slash allowed!
    image: './src/assets/images/wonderflow-logo-rectangle-small.png'
  },
  plugins: [
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/assets/images`
      }
    },
    {
      resolve: `gatsby-source-wordpress-experimental`,
      options: {
        url:
          process.env.GATSBY_SOURCE_URL ||
          `https://staging-website.wonderflow.co/graphql`,
        schema: {
          // Prefixes all WP Types with "Wp" so "Post and allPost"
          // become "WpPost and allWpPost".
          typePrefix: `Wp`
        },
        useAcf: true,
        verbose: true,
        develop: {
          hardCacheMediaFiles: true
        },
        debug: {
          graphql: {
            writeQueriesToDisk: true,
            copyHtmlResponseOnError: true
          }
        },
        type: {
          Post: {
            limit:
              process.env.NODE_ENV === `development`
                ? // Lets just pull fewer posts in development to make it easy on ourselves.
                  24
                : // and we don't actually need more than 100 in production for this particular site
                  100
          }
        }
      }
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-postcss`,
    // `gatsby-plugin-fontawesome-css`,
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        rule: {
          include: /\.inline\.svg$/
        }
      }
    },
    {
      resolve: 'gatsby-plugin-web-font-loader',
      options: {
        google: {
          families: ['Open Sans']
        }
      }
    },
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-advanced-sitemap`
  ]
}

gatsby.node

const { resolve } = require(`path`)
const path = require(`path`)
const glob = require(`glob`)
const chunk = require(`lodash/chunk`)
// const { dd } = require(`dumper.js`)
// const { createRemoteFileNode } = require(`gatsby-source-filesystem`)

const getTemplates = () => {
  const sitePath = path.resolve(`./`)
  return glob.sync(`./src/templates/**/*.js`, { cwd: sitePath })
}

//
// @todo move this to gatsby-theme-wordpress
exports.createPages = async ({ actions, graphql, reporter }) => {
  const templates = getTemplates()

  const {
    data: {
      allWpContentNode: { nodes: contentNodes }
    }
  } = await graphql(`
    query ALL_CONTENT_NODES {
      allWpContentNode(
        sort: { fields: modifiedGmt, order: DESC }
        filter: { nodeType: { ne: "MediaItem" } }
      ) {
        nodes {
          nodeType
          uri
          id
          ... on WpPage {
            id
            uitemplate {
              type
            }
          }
        }
      }
    }
  `)

  const contentTypeTemplateDirectory = `./src/templates/`
  const contentTypeTemplates = templates.filter((path) =>
    path.includes(contentTypeTemplateDirectory)
  )

  await Promise.all(
    contentNodes.map(async (node, i) => {
      const { nodeType, uri, id, uitemplate } = node
      // this is a super super basic template hierarchy
      // this doesn't reflect what our hierarchy will look like.
      // this is for testing/demo purposes
      let templatePath
      uitemplate && uitemplate.type
        ? (templatePath = `${contentTypeTemplateDirectory}${uitemplate.type}.js`)
        : (templatePath = `${contentTypeTemplateDirectory}${nodeType}.js`)

      const contentTypeTemplate = contentTypeTemplates.find(
        (path) => path === templatePath
      )

      if (!contentTypeTemplate) {
        return
      }

      await actions.createPage({
        component: resolve(contentTypeTemplate),
        path: uri,
        context: {
          id,
          nextPage: (contentNodes[i + 1] || {}).id,
          previousPage: (contentNodes[i - 1] || {}).id
        }
      })
    })
  )

  // create the blog roll
  const {
    data: { allWpPost }
  } = await graphql(`
    {
      allWpPost(sort: { fields: modifiedGmt, order: DESC }) {
        nodes {
          uri
          title
          link
          author {
            node {
              id
              name
            }
          }
          excerpt
        }
      }
    }
  `)

  const perPage = 10
  const chunkedContentNodes = chunk(allWpPost.nodes, perPage)

  await Promise.all(
    chunkedContentNodes.map(async (nodesChunk, index) => {
      const firstNode = nodesChunk[0]
      const page = index + 1
      const offset = perPage * index

      await actions.createPage({
        // component: resolve(`./src/templates/index.js`),
        component: resolve(`./src/pages/blog.js`),
        path: page === 1 ? `/blog/` : `/blog/${page}/`,
        context: {
          firstId: firstNode.id,
          page,
          offset,
          totalPages: chunkedContentNodes.length,
          perPage
        }
      })
    })
  )
}

package.json

{
  "name": "wonder-website",
  "description": "Wonderflow loves Gatsby",
  "license": "MIT",
  "version": "0.0.1",
  "author": {
    "name": "Beniamino Marini",
    "email": "ben@wonderflow.ai"
  },
  "scripts": {
    "purge:css": "cross-env NODE_ENV=production postcss src/util/styles/main.css -o src/index.css",
    "build:css": "postcss src/utils/styles/main.css -o src/index.css",
    "watch:css": "postcss src/utils/styles/main.css -o src/index.css -w",
    "dev": "gatsby develop",
    "clean": "gatsby clean",
    "build": "gatsby build",
    "clean-develop": "gatsby clean && gatsby develop",
    "clean-build": "gatsby clean && gatsby build",
    "start": "npm run build:css && npm run develop",
    "serve": "gatsby serve",
    "preload-fonts": "gatsby-preload-fonts"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "dependencies": {
    "@reach/router": "^1.3.4",
    "@tailwindcss/typography": "^0.2.0",
    "add": "^2.0.6",
    "cache-manager-fs-hash": "0.0.9",
    "dotenv": "^8.2.0",
    "gatsby": "^2.27.5",
    "gatsby-image": "^2.4.20",
    "gatsby-plugin-advanced-sitemap": "^1.5.6",
    "gatsby-plugin-postcss": "^3.0.4",
    "gatsby-plugin-react-helmet": "^3.5.0",
    "gatsby-plugin-react-svg": "^3.0.0",
    "gatsby-plugin-sharp": "^2.9.1",
    "gatsby-plugin-web-font-loader": "^1.0.4",
    "gatsby-source-filesystem": "^2.3.32",
    "gatsby-source-wordpress-experimental": "^1.7.11",
    "gatsby-transformer-sharp": "2.5.16",
    "prop-types": "^15.7.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-grid-system": "^7.1.1",
    "react-helmet": "^6.1.0",
    "react-paginate": "^6.5.0",
    "tailwindcss": "^1.4.6"
  },
  "devDependencies": {
    "babel-eslint": "^10.1.0",
    "cross-env": "^7.0.2",
    "cssnano": "^4.1.10",
    "eslint": "^7.12.0",
    "eslint-config-airbnb": "^18.2.0",
    "eslint-config-prettier": "^6.14.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.0",
    "eslint-plugin-prettier": "^3.1.4",
    "eslint-plugin-react": "^7.21.5",
    "postcss": "^8.1.6",
    "postcss-cli": "^8.2.0",
    "postcss-import": "^13.0.0",
    "postcss-preset-env": "^6.7.0",
    "prettier": "^2.2.1"
  },
  "resolutions": {
    "sharp": "0.24.0"
  }
}

Let me know if anything else could help — and thank you for reading until here! (and if you skipped until here, thank you anyway!)

chriswolmarans commented 3 years ago

I encountered the same issue, however I could not build locally either.

After updating gatsby-source-wordpress-experimental to the latest version, as well as updating WP-Gatsby on the WP instance to Version 0.6.7, I no longer get the [object Object] Input file contains unsupported image format error, not sure if that will help you, perhaps you want to give that a try @SRFeesha

Now when I run gatsby clean && gatsby build I'm seeing Error: Input file contains unsupported image format with Failed to retrieve metadata from image /Users/pathToFE/.cache/caches/gatsby-source-filesystem/69dbe5ab4a435056f4cf7515298026b2/dec2017-4-1.jpg Input file contains unsupported image format message.

success  gatsby-source-wordpress  MenuItem - 14.946s - fetched 19
success  gatsby-source-wordpress  Menu - 1.654s - fetched 2
success  gatsby-source-wordpress  Page - 15.294s - fetched 13
success  gatsby-source-wordpress  PostFormat - 0.803s - fetched 1
success  gatsby-source-wordpress  Post - 61.703s - fetched 69
success  gatsby-source-wordpress  Tag - 0.804s - fetched 0
success  gatsby-source-wordpress  Taxonomy - 1.556s - fetched 1
success  gatsby-source-wordpress  UserRole - 0.945s - fetched 0
success  gatsby-source-wordpress  User - 1.581s - fetched 2

 ERROR

Failed to retrieve metadata from image 
/Users/pathToFE/.cache/caches/gatsby-source-filesystem/69dbe5ab4a435056f4cf7515298026b2/dec2017-4-1.jpg Input file contains unsupported image format

  Error: Input file contains unsupported image format

not finished source and transform nodes - 137.946s
not finished  gatsby-source-wordpress  fetching nodes - 137.324s - 124 total
not finished Downloading remote files - 135.822s
not finished  gatsby-source-wordpress  creating nodes - 32.677s

When navigating to that image(.cache/caches/gatsby-source-filesystem/69dbe5ab4a435056f4cf7515298026b2/dec2017-4-1.jpg), I noticed that it has a zero kb file size.

I have tried the same points mentioned above in What I've tried above e.g. adding the following based on suggestions of previous github issues:

  "resolutions": {
    "sharp": "0.24.0"
  }

looking at .ico file, as well as setting GATSBY_CONCURRENT_DOWNLOAD=1 (from trying 150, 100, 50 etc) and changing schema and related settings in gatsby config:

{
      resolve: `gatsby-source-wordpress-experimental`,
      options: {
        html: {
          imageQuality: 100,
        },
        schema: {
          queryDepth: 10,
          perPage: 1,
          timeout: 50000
        },
        url:
          process.env.WPGRAPHQL_URL ||
          `https://someURL.io/graphql`,
        verbose: true,
        develop: {
          nodeUpdateInterval: 3000,
          hardCacheMediaFiles: true,
        },
        debug: {
          graphql: {
            writeQueriesToDisk: true,
          },
        },
        type: {
          Post: {
            limit:
              process.env.NODE_ENV === `development`
                ? // Lets just pull 50 posts in development to make it easy on ourselves.
                50
                : // and we don't actually need more than 5000 in production for this particular site
                500,
          },
        },
      },
    },

The FE dependencies are:

"dependencies": {
    "@ccalamos/gatsby-source-googlemaps-static": "^1.4.9",
    "@tailwindcss/custom-forms": "^0.2.1",
    "@tailwindcss/typography": "^0.2.0",
    "@wordpress/block-library": "^2.26.0",
    "autoprefixer": "^9.8.6",
    "gatsby-cli": "^2.14.1",
    "gatsby-image": "2.6.0",
    "gatsby-plugin-csp": "^1.1.3",
    "gatsby-plugin-eslint": "2.0.8",
    "gatsby-plugin-google-analytics": "^2.4.1",
    "gatsby-plugin-manifest": "2.3.7",
    "gatsby-plugin-offline": "^3.3.0",
    "gatsby-plugin-postcss": "2.2.4",
    "gatsby-plugin-purgecss": "4.0.1",
    "gatsby-plugin-react-helmet": "^3.3.14",
    "gatsby-plugin-react-svg": "^3.0.0",
    "gatsby-plugin-robots-txt": "^1.5.3",
    "gatsby-plugin-sharp": "2.9.0",
    "gatsby-plugin-sitemap": "^2.5.0",
    "gatsby-plugin-typescript": "2.3.5",
    "gatsby-source-filesystem": "2.6.1",
    "gatsby-source-wordpress-experimental": "^3.1.3",
    "gatsby-transformer-sharp": "2.7.0",
    "mobx": "^5.15.4",
    "mobx-react-lite": "^2.0.7",
    "mobx-state-tree": "^3.17.2",
    "postcss-cli": "^8.1.0",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-helmet": "^6.1.0",
    "tailwindcss": "^1.9.2"
  },

Any suggestions would be appreciated, not sure how to resolve this error at this point. All my WP plugins (WP GraphQL + WP Gatsby) are using the latest available version.

SRFeesha commented 3 years ago

I've managed to deploy on Netlify. Note, is not a proper fix, just a workaround.

I've tried to make a minimum reproducible repo and that leads me to the fact that sharp was causing the problem. I've updated gatsby-transofrmer-sharp to version 2.7.0 and set the flag of failOnError to false

{
    resolve: `gatsby-plugin-sharp`,
    options: {
      failOnError: false
    }
},

That made me compile — hopefully that helps you too :)

btw I'll continue my research because I feel it's just a workaround, gonna open an issue on sharp in the next hours. Gonna try also your suggestions @chriswalmarance, thank you in the meantime

TylerBarnes commented 3 years ago

Is this still an issue or does upgrading gatsby-transformer-sharp fix it?

damianxkozar commented 3 years ago

Still an issue. Removing gatsby plugin manifest helped for me.

TylerBarnes commented 3 years ago

Good to know, thanks! I have a feeling this is due to a corrupt image somewhere and the manifest plugin isn't handling that well. I'm focusing on a few other issues right now but I'll have a look at this afterwards.

chriswolmarans commented 3 years ago

I created a new WP install from backup (to try and rule out any potentially corrupt images) and removed gatsby-plugin-manifest, that did the trick for me, build completed successfully with no errors.

If I try building with gatsby-plugin-manifest installed, I get Error: Something went wrong installing the "sharp" module

TylerBarnes commented 3 years ago

Closing this issue as it doesn't seem to be related to this plugin. If anyone is still experiencing this I would recommend opening a new issue on the Gatsby repo with a title related to gatsby-plugin-manifest/gatsby-plugin-sharp and include a minimal reproduction repo of the problem so it can be easily debugged/fixed.

Thanks everyone :)