Closed SRFeesha closed 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.
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
Is this still an issue or does upgrading gatsby-transformer-sharp
fix it?
Still an issue. Removing gatsby plugin manifest helped for me.
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.
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
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 :)
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/CDThe error i get is:
I need advice to debug deploy https://app.netlify.com/sites/wonderful-kepler-5e8164/deploys/5fc627aed1f92d000856d4e9
Steps to reproduce
npm install
What I've tried
I've already tried the most common fixes found online but can't really fix it:
allWpMediaItem
: they're all jpg or pnggatsby.config
gatsby.node
package.json
Let me know if anything else could help — and thank you for reading until here! (and if you skipped until here, thank you anyway!)