gatsby-starter-decap-cms icon indicating copy to clipboard operation
gatsby-starter-decap-cms copied to clipboard

Testing edition of a page on netlify cms, automatic deploy on Netlify fails

Open DavidGeismarLtd opened this issue 3 years ago • 10 comments

Bug report

What is the current behavior? I edited page on netlify cms

If the current behavior is a bug, please provide the steps to reproduce. Edit a page on netlify cms

What is the expected behavior? Automatic deploy should not fail after page edition

Other relevant information:

10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "featuredimage" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "featuredimage". If you didn't expect "featuredimage" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "image" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "image". If you didn't expect "image" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "image" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "image". If you didn't expect "image" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "image" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "image". If you didn't expect "image" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "image" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "image". If you didn't expect "image" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "image" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "image". If you didn't expect "image" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: error There was an error in your GraphQL query:
10:02:51 AM:       Field "full_image" must not have a selection since type "String" has no subfields.
10:02:51 AM:       This can happen if you e.g. accidentally added { } to the field "full_image". If you didn't expect "full_image" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have.
10:02:51 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned
      "dummy content". Visit our docs to learn how you can define the schema for "undefined":
10:02:51 AM:       https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
10:02:51 AM: failed extract queries from components - 0.906s
10:02:51 AM: npm ERR! code ELIFECYCLE
10:02:51 AM: npm ERR! errno 1
10:02:51 AM: npm ERR! [email protected] build: `npm run clean && gatsby build`
10:02:51 AM: npm ERR! Exit status 1
10:02:51 AM: npm ERR!
10:02:51 AM: npm ERR! Failed at the [email protected] build script.
10:02:51 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:02:51 AM: npm ERR! A complete log of this run can be found in:
10:02:51 AM: npm ERR!     /opt/buildhome/.npm/_logs/2021-10-16T08_02_51_198Z-debug.log
10:02:51 AM: 

Node.js version: NPM/Yarn version Operating System: Additional tools:

DavidGeismarLtd avatar Oct 16 '21 08:10 DavidGeismarLtd

Howdy @DavidGeismarLtd! Could you provide a bit more detail on what page and what element you updated?

maxcell avatar Oct 25 '21 14:10 maxcell

@maxcell FYI, I was able to reproduce the bug by replacing the featured image to use a URL instead of using one of the uploaded images in the CMS.

If you'd like to reproduce it, you can follow the instructions on the netlify cms getting started page, pick the Gatsby template, replace the featured image with an image URL and publish. Your deploy should fail with 👇

Screenshot 2021-10-25 at 12 21 47

Otherwise, locally, in one of the posts' frontmatter, change the featuredimage to an image URL and you should see that it doesn't display the image.

I think the issue is in the GraphQL schema of the BlogRoll component:

  featuredimage {
    childImageSharp {
      fluid(maxWidth: 120, quality: 100) {
        ...GatsbyImageSharpFluid
      }
    }
  }

I think there's some changes we need to make so we can work with image URLs but I could be wrong, I haven't played with Gatsby in a while!

Our config.yml also seems to show that the type of featured images is image and not string so maybe that has to do with this as well 🤷‍♀️

charliegerard avatar Oct 25 '21 19:10 charliegerard

That makes sense to me! We can settle the migration process and go and investigate a bit more! I tried to fiddle with a few pages content and didn't think to try the images so at least we have a path forward!

maxcell avatar Oct 25 '21 20:10 maxcell

I've experience similar error, like this: Field "full_image" must not have a selection since type "String" has no subfields when editing a page. I revert my change and it still showed this error, and the whole site can't be develop locally. Doing gatsby clean to clear up the cache then running gatsby develop again fixed the issue as explained in here

sandhi-artha avatar Oct 31 '21 18:10 sandhi-artha

I'm also having the same issue uploading images via the the netlify-cms with the same error message as @charliegerard

Glad to see it's already being worked on! Thanks!

kyleslie2 avatar Nov 05 '21 03:11 kyleslie2

Any updates on this issue? I have just had this same error when trying to build for the first time locally.

matheusdamiao avatar Sep 26 '22 18:09 matheusdamiao

No updates, but I am gonna bring this back up to the team and figure out how we can prioritize it. Thank you for bumping it!

maxcell avatar Sep 26 '22 18:09 maxcell

@matheusdamiao Wait did you have this issue on a fresh deploy / build? Or similar issue where you included a remote URL for the featured image?

maxcell avatar Sep 28 '22 13:09 maxcell

@matheusdamiao What operating system are you using? Can you provide any details as far as your node version and NPM version?

maxcell avatar Oct 17 '22 12:10 maxcell

@matheusdamiao Wait did you have this issue on a fresh deploy / build? Or similar issue where you included a remote URL for the featured image?

The first option. I had this issue after cloning this repo and trying to develop locally. I didn't change anything within the repo but got a dozen of this error:

image

Node.js version: ">= 14.15.0" NPM: 8.1.2 Operating System: Windows 10 Pro x64

matheusdamiao avatar Oct 21 '22 12:10 matheusdamiao