-
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
docs: guide on troubleshooting common errors #19966
Conversation
Co-Authored-By: Michael <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome @gillkyle! Added some minor comments and edits.
Off the top of my head I'm thinking of some GraphQL query errors that we may want to add. They're mostly related to not having the file system plugin set up for the right directory in your project so Gatsby can't see the files you're trying to query. I'll track down the actual phrasing and add that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, Kyle! This looks awesome! It's going to help a ton of people. I have a bunch of notes/suggestions but only two of them are blocking: the broken link and the unfinished sentence.
|
||
## Errors building and deploying | ||
|
||
The process of building your site [varies slightly from the development process](/docs/overview-of-the-gatsby-build-process/). Some errors can arise when you build your site if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to finish this sentence. I'm not quite sure where it was going but it sounds important. 😄
Co-Authored-By: Aisha Blake <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woo hoo!! Great work on this!
|
||
Another possibility is that empty strings are used for image paths somewhere in your site, and when Gatsby constructs a GraphQL schema it [infers](/docs/glossary#inference) the wrong type because the empty string doesn't look like a path. | ||
Another possibility that could cause this issue is from empty strings used for image paths somewhere in your site. If this is the case, when Gatsby constructs a GraphQL schema it may [infer](/docs/glossary#inference) the wrong type because the empty string doesn't look like a file path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Description
This PR adds a reference guide to the section in the docs on "Debugging Gatsby".
I did a lot of Googling and used a search on GitHub to get the most 👍 (+1'd) comments in the Gatsby repo in DESC order. From there I tried to identify errors that people seemed to hit frequently that weren't real bugs (ie errors in Gatsby that need to be fixed) or things not supported yet (like adding variables to static queries).
I came up with a pretty short list and figured I could open up this PR to see if anyone else had suggestions and/or references for other commonly encountered errors. These are what are covered:
gatsby clean
Field "image" must not have a selection since type "String" has no subfields
window
In my opinion, this guide shouldn't be an alternative to stackoverflow or the issues tab. I think it does open up discussion about additional ways Gatsby can help guide users through these problems (one I thought of was would a potential
gatsby-plugin-image
library package upgatsby-plugin-sharp
gatsby-transformer-sharp
so that people don't include them in the wrong order and ease that installation and configuration process?).Documentation
There are some existing mentions of errors described and outlined in what I wrote up elsewhere in the docs and in plugin READMEs. I think an advantage of this doc is centralizing some common gotchas from those peripheral locations but providing links out to the guides that might have even more context.
Related Issues
Related to #19196