{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5638","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5638/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5638/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5638/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/5638","id":328234477,"node_id":"MDU6SXNzdWUzMjgyMzQ0Nzc=","number":5638,"title":"gatsby build always throwing Input file is missing or of an unsupported image format","user":{"login":"swashata","id":1623381,"node_id":"MDQ6VXNlcjE2MjMzODE=","avatar_url":"https://avatars1.githubusercontent.com/u/1623381?v=4","gravatar_id":"","url":"https://api.github.com/users/swashata","html_url":"https://github.com/swashata","followers_url":"https://api.github.com/users/swashata/followers","following_url":"https://api.github.com/users/swashata/following{/other_user}","gists_url":"https://api.github.com/users/swashata/gists{/gist_id}","starred_url":"https://api.github.com/users/swashata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swashata/subscriptions","organizations_url":"https://api.github.com/users/swashata/orgs","repos_url":"https://api.github.com/users/swashata/repos","events_url":"https://api.github.com/users/swashata/events{/privacy}","received_events_url":"https://api.github.com/users/swashata/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-31T17:44:50Z","updated_at":"2018-06-01T13:53:43Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  To make it easier for us to help you — please follow the suggested format below.\r\n\r\n  Useful Links:\r\n  - Documentation: https://www.gatsbyjs.org/docs/\r\n  - How to File an Issue: https://www.gatsbyjs.org/docs/how-to-file-an-issue/\r\n\r\n  Before opening a new issue, please search existing issues https://github.com/gatsbyjs/gatsby/issues\r\n-->\r\n\r\n## Description\r\n\r\nI have added `gatsby-plugin-remark` and `gatsby-transformer-remark` to optimize some images through frontmatter. The setup is really simple. Say I have a `md` file.\r\n\r\n```markdown\r\n---\r\ntitle: Beautiful UI\r\nfeatured_image: ../../images/project-vscbui.png\r\nsubtitle: A set of color themes for VSCode\r\norder: 90\r\nlink: https://vscbui.rocks\r\ntemplateKey: projects\r\n---\r\n\r\n...\r\n```\r\n\r\nIn `gatsby-config.js` I have\r\n\r\n```js\r\n// ....\r\n'gatsby-plugin-sharp',\r\n'gatsby-transformer-sharp',\r\n// ...\r\n```\r\n\r\nAnd I am querying the image like this\r\n\r\n```js\r\nexport const projectQuery = graphql`\r\n  query ProjectQuery {\r\n    projects: allMarkdownRemark(\r\n      sort: { order: DESC, fields: [frontmatter___order] }\r\n      filter: { frontmatter: { templateKey: { eq: \"projects\" } } }\r\n      limit: 1000\r\n    ) {\r\n      edges {\r\n        node {\r\n          id\r\n          frontmatter {\r\n            title\r\n            subtitle\r\n            featured_image {\r\n              childImageSharp {\r\n                sizes(maxWidth: 960) {\r\n                  ...GatsbyImageSharpSizes\r\n                }\r\n              }\r\n            }\r\n            link\r\n          }\r\n          html\r\n        }\r\n      }\r\n    }\r\n    site {\r\n      siteMetadata {\r\n        shortTitle\r\n      }\r\n    }\r\n  }\r\n`;\r\n```\r\n\r\nWhen doing so, `gatsby develop` runs fine and even shows the images. But when I run `gatsby build` it seems to work but in the end, it throws error\r\n\r\n```\r\nsuccess Building static HTML for pages — 3.818 s\r\nerror Input file is missing or of an unsupported image format\r\n\r\n\r\n  Error: Input file is missing or of an unsupported image format\r\n\r\nerror UNHANDLED REJECTION\r\n\r\n\r\n  Error: Input file is missing or of an unsupported image format\r\n```\r\n\r\nThe funny thing is, if I just ignore the error and serve with `gatsby serve` it seems to work perfectly fine. I don't know why the errors are happening.\r\n\r\nI have tried all approach for solving this\r\n\r\n1. Add `featured_image` to every frontmatter.\r\n2. Remove the `featured_image` query from graphql.\r\n3. Remove the `gatsby-remark-images` plugin.\r\n\r\nBut nothing seems to work, except for actually removing the images and the sharp plugin.\r\n\r\n### Steps to reproduce\r\n\r\n1. Clone this repo https://github.com/swashata/swas.io\r\n2. Run `yarn build`. It will throw the error.\r\n3. Run `yarn develop`, it will just work.\r\n\r\n### Expected result\r\n\r\nIt should have worked?!\r\n\r\n### Actual result\r\n\r\nIt failed.\r\n\r\nhttps://app.netlify.com/sites/optimistic-perlman-163196/deploys/5b103039dd6a543fe69ff5d4\r\n\r\nPS: I have actually tried removing that `hello-world-banner.jpg` image. Then it just fails on another image. I kept on removing until there's no image left. Then of course it worked.\r\n\r\nFor now, I have set netlify build command `yarn build || true` which just ignores the error and deploys anyway. You can it working good just here https://swas.io\r\n\r\n### Environment\r\n* Gatsby version (`npm list gatsby`): gatsby@1.9.215\r\n* gatsby-cli version (`gatsby --version`): 1.1.52\r\n* Node.js version: v9.11.1\r\n* Operating System: macOS 10.13.4 (17E202) (High Sierra)\r\n\r\n### File contents (if changed)\r\n`gatsby-config.js`: https://github.com/swashata/swas.io/blob/master/gatsby-config.js?ts=2\r\n`package.json`: https://github.com/swashata/swas.io/blob/master/package.json\r\n`gatsby-node.js`: https://github.com/swashata/swas.io/blob/master/gatsby-node.js?ts=2\r\n"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/393887551","html_url":"https://github.com/gatsbyjs/gatsby/issues/5638#issuecomment-393887551","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5638","id":393887551,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Mzg4NzU1MQ==","user":{"login":"swashata","id":1623381,"node_id":"MDQ6VXNlcjE2MjMzODE=","avatar_url":"https://avatars1.githubusercontent.com/u/1623381?v=4","gravatar_id":"","url":"https://api.github.com/users/swashata","html_url":"https://github.com/swashata","followers_url":"https://api.github.com/users/swashata/followers","following_url":"https://api.github.com/users/swashata/following{/other_user}","gists_url":"https://api.github.com/users/swashata/gists{/gist_id}","starred_url":"https://api.github.com/users/swashata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swashata/subscriptions","organizations_url":"https://api.github.com/users/swashata/orgs","repos_url":"https://api.github.com/users/swashata/repos","events_url":"https://api.github.com/users/swashata/events{/privacy}","received_events_url":"https://api.github.com/users/swashata/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T13:53:43Z","updated_at":"2018-06-01T13:53:43Z","author_association":"NONE","body":"It turns out I actually had a missing image file.\r\n\r\nI am using `gatsby-plugin-manifest` and the image path I have put there is `src/img/ninja.png`, but it should have been `src/images/ninja.png`. I changed the directory name before and totally forgot to refactor it for the config file. I have corrected and it is working just fine.\r\n\r\nIs it possible to add some better error message with atleast the filename so that we could know from where the issue is coming?"}}
{"actor":{"display_login":"swashata"}}