-
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
GraphQL Error Error Field "image" must not have a selection since type "String" has no subfields. #3531
Comments
What does your markdown file look like? |
@KyleAMathews : here is my markdown file
If you want, I put my repo public https://github.com/MaralS/autocontrole.git I deleted the branch develop because it caused such a mess ! -_- |
Often what is happening here is that it'll work with one markdown file but stop working with a new one as the new file changes the "type" of one of the frontmatter fields. E.g. perhaps in your develop branch, a markdown file was added where |
@KyleAMathews What can I do ? Delete the first blog post and recreate a new one ?? |
Did you add new markdown files on the develop branch? |
@KyleAMathews No, I completely removed the branch I didn't do new work. I saw that caused the problem I remove from locally and remotely |
@KyleAMathews so what can I do ? |
@MaralS you mis-typed the image file name :-) https://github.com/MaralS/autocontrole/blob/master/src/pages/conseils/12-12-2017-bonjour-tout-le-monde/index.md |
@KyleAMathews I hate myself right now, thank you so much ! I think I'm too tired... XD |
@KyleAMathews having the schema defined before hand would avoid this issue. I have been wrestling similar issues because of markdowns having different frontmatter. |
@Jaikant check #3344 (comment) - I'm actually working on that |
I've run into this a LOT. Is there any way to add some debugging info to figure out which file or source prompted Gatsby to interpret a field as String instead of File? |
@coreyward could you put up a reproduction of the problem? I put a bunch of time fixing this late last fall and haven't heard many if any complaints since. Also please double-check you're on the latest version of Gatsby :-) |
This is where the logic for determining if a field points to a file ishttps://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/types/type-file.js |
Mine is not exactly the same situation but very similar from my perspective:
Error in terminal:
gatsby-config.js const path = require( 'path' );
module.exports = {
siteMetadata: {
title: 'nackle'
},
plugins: [
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'content',
path: path.resolve( __dirname, './content/' )
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'resources',
path: path.resolve( __dirname, './resources/' )
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-autolink-headers'
],
},
},
{
resolve: 'gatsby-plugin-sass',
options: {
includePaths: [
path.resolve( __dirname, './node_modules' ),
path.resolve( __dirname ),
]
}
},
'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet'
],
}; The |
Description
GraphQL error.
Environment
Gatsby version: 1.1.27
Node.js version: 8.9.3
Operating System: OSX El Capitan
File contents (if changed):
package.json
:gatsby-node.js
:Actual result
Expected behavior
No error message, display all the blog posts with their featured image.
Steps to reproduce
1. I created a branch named
develop
2. I did a new commit and pushed on the repository
3. I restarted the server
yarn develop
and the error message occurredI also tried to :
.cache
folderyarn install
yarn develop
Everything worked fine before the creation of the branch. It's very frustrating actually because I struggled with this type of issue kinda week.
Anyone can help ?
Thanks
Maral
The text was updated successfully, but these errors were encountered: