The full description of the issue can be found here https://github.com/gatsbyjs/gatsby/issues/5638
In short, I am using gatsby-plugin-remark
and gatsby-transformer-remark
to optimize images placed within frontmatter of md files.
Say my markdown file has
---
title: Beautiful UI
featured_image: ../../images/project-vscbui.png
subtitle: A set of color themes for VSCode
order: 90
link: https://vscbui.rocks
templateKey: projects
---
...
And I query it like
export const projectQuery = graphql`
query ProjectQuery {
projects: allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___order] }
filter: { frontmatter: { templateKey: { eq: "projects" } } }
limit: 1000
) {
edges {
node {
id
frontmatter {
title
subtitle
featured_image {
childImageSharp {
sizes(maxWidth: 960) {
...GatsbyImageSharpSizes
}
}
}
link
}
html
}
}
}
site {
siteMetadata {
shortTitle
}
}
}
`;
gatsby develop
works just fine. But when I run gatsby build
, it fails giving errors
success Building static HTML for pages — 3.818 s
error Input file is missing or of an unsupported image format
Error: Input file is missing or of an unsupported image format
error UNHANDLED REJECTION
Error: Input file is missing or of an unsupported image format
Although the build actually works just fine.
To reproduce, please fork this repository https://github.com/swashata/swas.io and run yarn build
. An error log can also be found here https://app.netlify.com/sites/optimistic-perlman-163196/deploys/5b10e5cdb3127429bf8a5d5d
I have tried all approach for solving this
- Add featured_image to every frontmatter.
- Remove the featured_image query from graphql.
- Remove the gatsby-remark-images plugin.
But nothing seems to work, except for actually removing the images and the sharp plugin.
Any help in finding the issue is very appreciated.