-
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
"Field "image" must not have a selection since type "String" has no subfields." #13469
Comments
@kpennell if you don't mind the wait, i'm cloning your repo and i'm going to create a detailed answer to your issue probably still tonight or at the very latest tomorrow. Sounds good? |
@jonniebigodes Thanks so much...and for responding to probably a half dozen of these now. Really wish you didn't have to |
I think I figured it out. In Gatsby-config, the order of plugins does matter here:
from here: https://theleakycauldronblog.com/blog/problems-with-gatsby-image-and-their-workarounds/
Hoping this helps someone in the future. Thank you @jonniebigodes |
@kpennell no need to thank. Glad you managed to figure it out. |
It was hell...but I did learn a lot.
…On Thu, Apr 18, 2019 at 4:42 PM jonniebigodes ***@***.***> wrote:
@kpennell <https://github.com/kpennell> no need to thank. Glad you
managed to figure it out.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13469 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIC4IO7O3PZDUROZXIPL2LPREBOXANCNFSM4HHANQPQ>
.
|
|
@kenold uh, yeah...like my answer above. |
@kpennell I thanked you in my comment :-). For some reasons, it's happening again but on a different computer. Strange! Fixed: I had an empty image string in my frontmatter like this: image: "" |
@kenold glad it helped. Hopefully you spent much less time than I did. |
…esource' of type 'File' must have a selection of subfields For reference, this was the fix: gatsbyjs/gatsby#13469 (comment)
This error seems to occur if the referenced image file(s) does not exist. Not exactly sure why and the error message is little help. In summary, check image files are correctly named and located as per the query. |
I had to tackle this twice using ForestryCMS. In the end I made a lot of changes, and I'm not too sure what specifically was the cause of the issue. I reordered my gatsby-config so that gatsby-source-filesystem for my asset folder was the first plugin loaded. In addition, the next three plugins I loaded were the gatsby-plugin-sharp, gatsby-transformer-sharp and then gatsby-transformer-remark. Then, moving to my gatsby-node.js, I added this bit of code, related to gatsby-remark-relative-images. Still, nothing worked, and I was pulling my hair out by this point. Finally, after much groaning, I found a repo that had added "pathFields" option to gatsby-remark-normalize-paths. I have no idea what this option does. The documentation for normalize-paths just says "Note: If you don’t want this plugin delete empty frontmatter of some fields, you need to specify pathFields", and that's all it says on the matter of pathFields. But I threw it in anyway. And lo and behold! It worked! I took a break for a few hours, very happy that I had somehow fixed my error. Only to find it had returned! Luckily, this time it was for a good reason: one of my blog posts contained a reference to an image that no longer existed. It took me a while to narrow this down... the error message was frustratingly cryptic. It made no mention of the file that was referencing the missing image, so I had to go through it piece by piece. Oh well. At least it works. For now. I hope this helps someone else on their adventures. |
If anybody is struggling with this issue with MDX, remember this little jewel from the docs: Then configure the plugins. gatsby-source-filesystem needs to be pointed at wherever you have your images on disk, gatsby-remark-images needs to be both a sub-plugin of gatsby-plugin-mdxand a string entry in the plugins array, and gatsby-plugin-sharp can be included on its own. |
Fixes some odd image buggy behaviour. gatsbyjs/gatsby#13469
Hello. I have the same problem and none of these suggestions help. Plugin order don't work. I am using Forestry CMS and deploying site in Netlify. |
Config restructure to fix image field gatsbyjs/gatsby#13469
@runchuks - yeah it seems like gatsby-transformer-remark or one of the plugins is not friendly with Windows. I was trying to get it working for other people's benefit, but I know that Linux and MacOS don't have this problem. Definitely set up WSL2 Ubuntu for Windows... I've been using it and I don't have this issue. |
Tried the following things without luck:
|
I was having this issue too. Moving
and it should have been
|
Description
I love love love Gatsby...But I'm another person struggling 😭😭😭 for 12+ hours now with "Field "image" must not have a selection since type "String" has no subfields."
I'm trying to to use netlify-cms and gatsby (with several popular gatsby image plugins).
I think this is a relative paths image problem but nothing has helped. I really just need someone to look at my setup.
Research:
I tried the various suggestions found at this issues.
gatsby issue 4123 gatsby issue 11412 gatsby issue 11534 gatsby issue 2050 gatsby issue 3531gatsby remark plugin issue 2 netlify-cms issue 325
Steps to reproduce
Here's the pertinent parts of the code
`[bunch of imports]
Actual markdown for a course:
Confirming that case and spelling are right
gatsby-config.js
gatsby-node.js
package.json
relevant parts:
All code here: https://github.com/kpennell/notworkinggatsbyrelativeimageproblem
Expected result
GraphQL should be able to query for the images (using the right path?) and have the transformers plugins work vs. only being able to query for a string.
Actual result
Infamous:
"Field "image" must not have a selection since type "String" has no subfields."
Environment
The text was updated successfully, but these errors were encountered: