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

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulContentType", or "ContentfulBlogPostEdge"? #16455

Closed
EdinK1 opened this issue Aug 8, 2019 · 69 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: GraphQL Related to Gatsby's GraphQL layer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@EdinK1
Copy link

EdinK1 commented Aug 8, 2019

ERROR #85901 GRAPHQL

I'm trying to fetch my blogs from contentful and it's giving me a weird error.
The only reason I am opening this issue is because the error told me to so.

This is what the error said:
Error: The result of this StaticQuery could not be fetched.

"This is likely a bug in Gatsby and if refreshing the page does not fix it, please open an issue in https://github.com/gatsbyjs/gatsby/issues"

gatsby info output:

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
Binaries:
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.7.2
Browsers:
Edge: 44.18362.1.0
npmPackages:
gatsby: ^2.13.51 => 2.13.51
gatsby-plugin-sass: ^2.1.4 => 2.1.4
gatsby-plugin-sharp: ^2.2.10 => 2.2.10
gatsby-remark-images: ^3.1.7 => 3.1.7
gatsby-remark-relative-images: ^0.2.3 => 0.2.3
gatsby-source-contentful: ^2.1.18 => 2.1.18
gatsby-source-filesystem: ^2.1.9 => 2.1.9
gatsby-transformer-remark: ^2.6.11 => 2.6.11

error UNHANDLED REJECTION

Error: The system cannot find the path specified.

  • envinfo.js:1 Function.e.exports.sync
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:4908

  • envinfo.js:1 Object.copySync
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:66886

  • envinfo.js:1 Object.t.writeSync
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:48715

  • envinfo.js:1
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:46872

  • envinfo.js:1
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:46887

  • task_queues.js:88 processTicksAndRejections
    internal/process/task_queues.js:88:5

@gatsbot gatsbot bot added the type: question or discussion Issue discussing or asking a question about Gatsby label Aug 8, 2019
@lannonbr
Copy link
Contributor

lannonbr commented Aug 8, 2019

Hi @EdinK1, would you be willing to share a repo for this codebase so we can dive deeper and figure out what specifically is causing this error to appear. If not, can you make a reproduction of this?

@lannonbr lannonbr added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Aug 8, 2019
@EdinK1
Copy link
Author

EdinK1 commented Aug 8, 2019

Hi @lannonbr . Sure here's the link to my repo. The problem seems to be coming from the fragments.js on the gatsbty-source-contenful folder. I've gitignored the node modules folder. Let me know if you need to take a look at the node modules as well.

@lwatson2
Copy link

lwatson2 commented Aug 8, 2019

I also just got this error. I was following this tutorial https://www.youtube.com/watch?v=8t0vNu2fCCM&t=13486s and when I tried adding a query on blog.js it gave me a error. The weird thing is that it was working before in graphi.

@izulki
Copy link

izulki commented Aug 9, 2019

I'm able to reproduce this error while following this: https://itnext.io/content-management-with-gatsby-netlify-and-contentful-70f03de41602.

Deleting the node_modules/gatsby-source-contentful/sec/fragments.js seemed to have "fixed" the error.

@EdinK1
Copy link
Author

EdinK1 commented Aug 9, 2019

Hmm, yeah it worked for me as well. I don't know if this is the correct way of doing it but thanks anyways!

@abhinav-anshul
Copy link

I am getting a similar error, deleting fragments file is not working for me. Anybody found a solution yet?

@EdinK1
Copy link
Author

EdinK1 commented Aug 10, 2019

Deleting the fragments file should do the trick. Try restarting your server.

@abhinav-anshul
Copy link

Thank you, it worked by deleting the fragments file, Although it seems more like a workaround than a true solution. Anybody dug deep into this?

@Kureyko
Copy link

Kureyko commented Aug 11, 2019

Same problem here, cant find whats the problem with contentful images

export const mainQuery = graphql`
  query {
    contents: allContentfulContents {
      edges {
        node {
          slug
          title
          content {
            json
          }
          cover {
            fluid {
              ...GatsbyContentfulFluid_noBase64
            }
          }
          gallery {
            id
            fluid {
              src
            }
          }
        }
      }
    }
  }
`

Tried all of the contentful fragments, none of them works.

@EdinK1
Copy link
Author

EdinK1 commented Aug 11, 2019

export const query = graphql`
  query {
    contentfulBlogPost {
      title
      publishedDate
      body {
        json
      }
    }
  }
`

I believe this is where all your images and content from your contentful blog is. (body { json } )

@Kureyko
Copy link

Kureyko commented Aug 11, 2019

Update: after updating gatsby-source-contentful, seems that bug is gone, at least, i got my images now. But previously, i got same error message, that said, that error is propobally from Gatsby & i should post about that error here, on github.

@silverqx
Copy link

silverqx commented Aug 12, 2019

I have the same problem.

gatsby@2.13.59
gatsby-source-contentful@2.1.19
gatsby-source-contentful@2.0.75 ( tried older version too, the same problem )

I have created gatsby project like this:
gatsby new great_gatsby_bootcamp https://github.com/gatsbyjs/gatsby-starter-hello-world

Installed gatsby-source-contentful@2.1.19 and setup env. variables, like is described in README.md.

Created some simple content model:
content-model

And created some content and after run gatsby develop get this errors:
output.txt

Nothing special, almost in a default configuration.

React application at localhost:8000 don't work, I can query contentful by graphql playground.

@dtakeiteasy
Copy link

Had the same issue, try reinstall gatsby-source-contentful to Version 2.1.19, worked for me.
npm install --save gatsby-source-contentful

@abhinav-anshul
Copy link

I tried reinstalling, but no luck. I think its more of a bug or version clash rather than error

@Kureyko
Copy link

Kureyko commented Aug 13, 2019

I tried reinstalling, but no luck. I think its more of a bug or version clash rather than error

I did following steps:

  1. Deleted fragments.js from gatsby-source-contentful node_modules
  2. Updated gatsby-cli
  3. Cleared cache npm run clean
  4. Tried to gatsby develop, but got error (On other forums, some people managed to fix bug on this step)
  5. Updated source-contentful npm install --save gatsby-source-contentful
  6. Cleared cache npm run clean
  7. gatsby develop and success - its working.

@silverqx
Copy link

I downgraded npm i gatsby@2.3 gatsby-source-contentful@2.0

@ashr81
Copy link
Contributor

ashr81 commented Aug 13, 2019

Add an image in your media files in your contentful. And try an image inside your post. This fixed issue for me. How and why I am not sure.

@dreilacadin
Copy link

dreilacadin commented Aug 13, 2019

For those having the same error, I resolved mine without deleting any data or downgrading any packages by doing these steps:

  1. Go into your Contentful space
  2. Click on the 'Media' tab and add a single asset as a dummy image to act as a placeholder
  3. restart dev server by running npm run develop or gatsby develop

Hopefully, this solves your issues as well though It might be helpful if someone can enlighten us why this is the case.

@silverqx
Copy link

Adding of a image helped, image have to be published

@AbuSalem0324
Copy link

AbuSalem0324 commented Aug 17, 2019

I still have this issue. Yesterday it worked when I uploaded a placeholder image, when I moved ahead with the same tutorial, stopped working.
Now I deleted fragment.js (actually just commented out the entire file, to avoid data loss), works fine again.

@bogodars
Copy link

Have the same issue. Deleting fragments.js - helped.

@pedoch
Copy link

pedoch commented Aug 27, 2019

Deleting the fragments.js file helped remove the error. Although I'm not sure that's a proper solution.
I'm still confused as to how that worked,

@MatBasiak
Copy link

MatBasiak commented Sep 2, 2019

Have the same problem. Adding a dummy image on the "Media" tab fixed the issue

@RLloyd
Copy link

RLloyd commented Sep 8, 2019

Adding image placeholder worked for me

@wardpeet
Copy link
Contributor

Can you check if gatsby-source-contentful@2.1.35 fixed this issue. @frodd might think his fix could be related.

@silverqx
Copy link

silverqx commented Sep 11, 2019

I would test it, but I can create only 2 spaces at contentful and i'm using both now :/, I can't delete any of them, any other good fairy which can test it? :) thx

@aurma97
Copy link

aurma97 commented Sep 16, 2019

Hey, i solved it by just deleting all the content of the fragment.js, nothing else, it didn't work when i deleted the file, but just the content.

@darmentrout
Copy link

darmentrout commented Feb 19, 2020

I'm getting the same error as well.

edit: adding an image asset and creating a blog post displaying that image seems to have "fixed" the problem

myName@myComputer:~/www/gatsby-bootcamp$ rm -rf .cache && npm run develop

> gatsby-starter-hello-world@0.1.0 develop /home/myName/www/gatsby-bootcamp
> env-cmd -f env.development gatsby develop

success open and validate gatsby-configs - 0.067s
success load plugins - 2.227s
success onPreInit - 0.005s
success initialize cache - 0.014s
success copy gatsby files - 0.117s
success onPreBootstrap - 0.015s
success createSchemaCustomization - 0.489s
Starting to fetch data from Contentful
Fetching default locale
default locale is : en-US
contentTypes fetched 1
Updated entries  2
Deleted entries  0
Updated assets  0
Deleted assets  0
Fetch Contentful data: 315.783ms
success source and transform nodes - 0.600s
success building schema - 0.405s
success createPages - 0.032s
success createPagesStatefully - 0.072s
success onPreExtractQueries - 0.004s
success update schema - 0.037s

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:20:37


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:34:47


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:48:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:61:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:77:55


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:92:37


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:106:47


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:120:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:133:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:149:55


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:161:43


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:171:53


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:181:52


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:190:52


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:202:61


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:213:37


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:223:47


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:233:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:242:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:254:55

failed extract queries from components - 0.695s
success write out requires - 0.037s
success write out redirect data - 0.007s
success onPostBootstrap - 0.003s
⠀
info bootstrap finished - 9.644 s
⠀
success run queries - 0.148s - 11/12 80.81/s
success Generating image thumbnails - 0.900s - 3/3 3.33/s
⠀
You can now view gatsby-starter-hello-world in the browser.
⠀
  http://localhost:8000/
⠀
View the GraphQL Playground, an in-browser IDE, to explore your site's data and schema
⠀
  http://localhost:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use gatsby build
⠀
success Building development bundle - 5.216s

@scowalt
Copy link

scowalt commented Feb 20, 2020

This issue really shouldn't be closed. It has a known cause (using a Contentful space with no media assets). It also has a decent impact considering the number of comments and reactions to comments on this discussion.

Is there any way we can get this reactivated and prevent the bots from closing it?

(Off-topic: I really dislike the trend of maintainers running bots that auto-close issues. Just because something hasn't had a comment in 30 days doesn't make an issue less real or impactful. It encourages unhelpful "+1" comments to keep an issue "alive")

@bsonntag
Copy link
Contributor

I agree that this should still be open, so I'm reopening.
Anyone has any idea on how to fix this?

@bsonntag bsonntag reopened this Feb 20, 2020
@bsonntag bsonntag added topic: plugins type: bug An issue or pull request relating to a bug in Gatsby and removed stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby labels Feb 20, 2020
@joshuagagne
Copy link
Contributor

joshuagagne commented Feb 23, 2020

Dupe of #15397 not really sure which one is really the best thread to keep open.

I added some details on the other thread about what I found recently; about when this was introduced; and a location we could insert a hook to fix it.

@esentai8
Copy link

esentai8 commented Mar 4, 2020

I added below config to the gatsby-config.js:
{ resolve: "gatsby-source-filesystem", options: { name: "src", path: ${__dirname}/src, }, }

@dthunn
Copy link

dthunn commented Mar 7, 2020

Just had the same issue, added an image to media assets like suggested and it worked. Makes no sense but did the trick...

@kwibus2000
Copy link

kwibus2000 commented Mar 13, 2020

The same... after adding an image in Contentful, the issue is gone. The weirdest thing I have ever seen ... ;-9
And: It is not only happening to us, humble earthlings, but you can also see the same happening here: https://www.youtube.com/watch?v=T9hLWjIN-pY
After trying all tricks up their sleeves, finally uploading an image makes it work. Jason Lengstorf himself admits that it is 'definitely a Gatsby issue'!

@urjit2498
Copy link

ERROR #85901 GRAPHQL

I'm trying to fetch my blogs from contentful and it's giving me a weird error.
The only reason I am opening this issue is because the error told me to so.

This is what the error said:
Error: The result of this StaticQuery could not be fetched.

"This is likely a bug in Gatsby and if refreshing the page does not fix it, please open an issue in https://github.com/gatsbyjs/gatsby/issues"

gatsby info output:

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
Binaries:
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.7.2
Browsers:
Edge: 44.18362.1.0
npmPackages:
gatsby: ^2.13.51 => 2.13.51
gatsby-plugin-sass: ^2.1.4 => 2.1.4
gatsby-plugin-sharp: ^2.2.10 => 2.2.10
gatsby-remark-images: ^3.1.7 => 3.1.7
gatsby-remark-relative-images: ^0.2.3 => 0.2.3
gatsby-source-contentful: ^2.1.18 => 2.1.18
gatsby-source-filesystem: ^2.1.9 => 2.1.9
gatsby-transformer-remark: ^2.6.11 => 2.6.11

error UNHANDLED REJECTION

Error: The system cannot find the path specified.

  • envinfo.js:1 Function.e.exports.sync
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:4908
  • envinfo.js:1 Object.copySync
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:66886
  • envinfo.js:1 Object.t.writeSync
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:48715
  • envinfo.js:1
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:46872
  • envinfo.js:1
    [v12.0.0]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:46887
  • task_queues.js:88 processTicksAndRejections
    internal/process/task_queues.js:88:5

You have to add image in contentful site because in body part you select rich textbox so add any image and then restart your server and these error will be gone.

Give feedback or suggestion for better solution rather than this solution. #happyCoding :)

@liam-brooks
Copy link

adding

{ resolve: "gatsby-source-filesystem", options: { name: "src", path: ${__dirname}/src, }, }

the gatsby-config.js helped

@sarojkumar007
Copy link

I'm able to reproduce this error while following this: https://itnext.io/content-management-with-gatsby-netlify-and-contentful-70f03de41602.

Deleting the node_modules/gatsby-source-contentful/sec/fragments.js seemed to have "fixed" the error.

Fixed the problem for me. Thanks

@Abhishek-framewirk
Copy link

Thanks man it worked for me :)

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Apr 22, 2020
@bsonntag
Copy link
Contributor

Is there a way to disable this? ☝️

This issue affects everyone that uses Gatsby with Contentful. In my opinion it should not be closed until we find a fix for this (an actual fix, not a work-around).

@bsonntag bsonntag added topic: GraphQL Related to Gatsby's GraphQL layer not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Apr 23, 2020
@LekoArts
Copy link
Contributor

This is a duplicate now of #15397 and we'd like to track it there.

@JBusani
Copy link

JBusani commented May 5, 2020

For those having the same error, I resolved mine without deleting any data or downgrading any packages by doing these steps:

  1. Go into your Contentful space
  2. Click on the 'Media' tab and add a single asset as a dummy image to act as a placeholder
  3. restart dev server by running npm run develop or gatsby develop

Hopefully, this solves your issues as well though It might be helpful if someone can enlighten us why this is the case.

Adding an image to the media assets worked for me too. Don't know why either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: GraphQL Related to Gatsby's GraphQL layer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.