-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gatsby-plugin-manifest] build fails with cryptic error if icon specified in config doesn't exist #5638
Comments
It turns out I actually had a missing image file. I am using Is it possible to add some better error message with atleast the filename so that we could know from where the issue is coming? |
Would you like to create PR for it? You would have to check for example here https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-manifest/src/gatsby-node.js#L52-L60 and reject promise if source icon is defined in config, but doesn't exists |
So stupid of megit add -A See gatsbyjs/gatsby#5638
Yes, thank you. I will definitely take a look and will try my best. I have spent two days figuring it out (feeling really stupid now) so an error message can really help someone. I have read this https://www.gatsbyjs.org/docs/how-to-contribute/#contributing-to-the-repo Any quick pointer on how to setup the development and work specifically on this and create a test case which will fail? I do not see any tests being done there, so perhaps I can setup something like jest? Is it okay? |
For local dev everything should be mentioned in docs you linked. Some plugins do use jest (for example https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sharp/src/__tests__) and travis will run those tests as part of pull request checks, so if You are up for it - defenitely give it a go. |
Great I will give it a go then. |
Just chimed in to say that I will be doing this today. |
gatsby-plugin-manifest will throw an error if the icon defined in gatsby-config.js does not exist. If it does exist, then console.log a better message about what is being done. See gatsbyjs#5638
The tests ensure the default icon src configs and behavior of the newly introduced check for detecting the presense of icon src mentioned in the gatsby-config.js file. See gatsbyjs#5638
* throw error if icon does not exist for manifest gatsby-plugin-manifest will throw an error if the icon defined in gatsby-config.js does not exist. If it does exist, then console.log a better message about what is being done. See #5638 * add tests for gatsby-plugin-manifest The tests ensure the default icon src configs and behavior of the newly introduced check for detecting the presense of icon src mentioned in the gatsby-config.js file. See #5638
Description
I have added
gatsby-plugin-remark
andgatsby-transformer-remark
to optimize some images through frontmatter. The setup is really simple. Say I have amd
file.In
gatsby-config.js
I haveAnd I am querying the image like this
When doing so,
gatsby develop
runs fine and even shows the images. But when I rungatsby build
it seems to work but in the end, it throws errorThe 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.I have tried all approach for solving this
featured_image
to every frontmatter.featured_image
query from graphql.gatsby-remark-images
plugin.But nothing seems to work, except for actually removing the images and the sharp plugin.
Steps to reproduce
yarn build
. It will throw the error.yarn develop
, it will just work.Expected result
It should have worked?!
Actual result
It failed.
https://app.netlify.com/sites/optimistic-perlman-163196/deploys/5b103039dd6a543fe69ff5d4
PS: 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.For 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.ioEnvironment
npm list gatsby
): gatsby@1.9.215gatsby --version
): 1.1.52File contents (if changed)
gatsby-config.js
: https://github.com/swashata/swas.io/blob/master/gatsby-config.js?ts=2package.json
: https://github.com/swashata/swas.io/blob/master/package.jsongatsby-node.js
: https://github.com/swashata/swas.io/blob/master/gatsby-node.js?ts=2The text was updated successfully, but these errors were encountered: