gatsby-typescript icon indicating copy to clipboard operation
gatsby-typescript copied to clipboard

Minified react error: Objects are not valid as a React child error

Open spond-canoo opened this issue 2 years ago • 1 comments

Describe the bug Using plugin results in error

Minified react error.... Objects are not valid as a React child (found: AggregateError: GraphQL Document Validation failed with 13 errors; Error 0: GraphQLDocumentError: Cannot query field "contentfulMarkdownContent" on type "Query". Did you mean "contentfulDropdownItem", "contentfulComponentText", "contentfulFooPageNew", "contentfulComponentHero", or "contentfulComponentNav"

To Reproduce Configure plugin gatsby-plugin-typescript and start project.

{ resolve: 'gatsby-plugin-graphql-codegen', options: { documentPaths: [ './src/**/*.{ts,tsx}', './.cache/fragments/*.js', './.cache/fragments/*.ts', '../../node_modules/gatsby-*/**/*.js', '../../node_modules/gatsby-*/**/*.ts', ], }, },

Environment (please complete the relevant info):

  • OS (Mac, Linux, Window, etc.)
  • Mac
  • Gatsby version 5.9.0
  • Typescript version -4.4.0

Additional context Using with gatsby-source-contentful Monorepo structure

spond-canoo avatar Mar 19 '22 18:03 spond-canoo

Hi there, did you try exluding your plugin ?

{
	resolve: `gatsby-plugin-graphql-codegen`,
	options: {
		documentPaths: [
			 './src/**/*.{ts,tsx}',
			 './.cache/fragments/*.{js,ts}',
			 '../../node_modules/gatsby!(*source-contentful)/**/*.{js,ts}',
		],
	},
},

thibault-mahe avatar May 16 '22 17:05 thibault-mahe