cometkim / gatsby-plugin-typegen

Let's give developers using GatsbyJS better DX with extreme type-safety
https://www.gatsbyjs.org/packages/gatsby-plugin-typegen/
MIT License
204 stars 23 forks source link

Intermittent errors with Gatsby Cloud builds #109

Closed Samic8 closed 2 years ago

Samic8 commented 4 years ago

I'm getting this error occasionally with Gatsby Cloud builds. Triggering a new build usually results in another build that is successful without errors.

[typegen] An error on codegen GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbySanityImageFixed". GraphQLDocumentError: Unknown fragment "GatsbySanityImageFixed". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFixed". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbySanityImageFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbySanityImageFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbySanityImageFluid". GraphQLDocumentError: Unknown fragment "GatsbyImageSharpFluid". GraphQLDocumentError: Unknown fragment "GatsbySanityImageFluid".
pascaloliv commented 4 years ago

I'm facing the same issue on GatsbyImageSharp fragments in my CI at the moment. It randomly break my build (I'm using Buddy)

FYI - I'm using gatsby-plugin-typegen@2.2.1

daniel-trevino commented 4 years ago

I've experienced the same error as you. In my case, I could only see this error after having a gatsby clean and trying to do gatsby build (without running gatsby dev beforehand)

Try to change the order on how you load the plugin in gatsby-config. In my case, moving it at the end of the array solved the issue.

Good luck 👍

Samic8 commented 4 years ago

Hi @danielivert. I changed the order and still getting the error. Are you using Gatsby cloud?

cometkim commented 3 years ago

I believe it should be related to #113, affected by upstream behavior change.

But there is no time for maintenance these days 😢 will try my best this weekend

Samic8 commented 3 years ago

Hi, @cometkim I'm happy to help with a PR to resolve this issue. But I may need some guidance. Let me know if my time would be helpful and if it's worth your time to explain the solution. Thanks!

cometkim commented 3 years ago

Hi @Samic8,

I was off here for months but now started over. You can watch the progress at #138. I'm going to change the behavior, so I don't recommend code contribution for now. But I will request you to test when the pre-release is ready.

Samic8 commented 3 years ago

Hey @cometkim any update on this? I'm more than happy to help out fixing it if needed. Thanks!

cometkim commented 2 years ago

In v3, gatsby-plugin-typegen will not run on Gatsby Cloud env anymore.