Skip to content
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

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

Open
DavidGeismarLtd opened this issue Oct 16, 2021 · 10 comments
Assignees

Comments

@DavidGeismarLtd
Copy link

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! gatsby-starter-netlify-cms@1.1.3 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 gatsby-starter-netlify-cms@1.1.3 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:

@maxcell
Copy link
Contributor

maxcell commented Oct 25, 2021

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

@charliegerard
Copy link
Contributor

@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 🤷‍♀️

@maxcell
Copy link
Contributor

maxcell commented Oct 25, 2021

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!

@sandhi-artha
Copy link

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

@maxcell maxcell self-assigned this Nov 3, 2021
@kyleslie2
Copy link

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!

@matheusdamiao
Copy link

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

@maxcell
Copy link
Contributor

maxcell commented Sep 26, 2022

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
Copy link
Contributor

maxcell commented Sep 28, 2022

@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
Copy link
Contributor

maxcell commented Oct 17, 2022

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

@matheusdamiao
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants