datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

Build errors "schema.buildEnumType is not a function" & "DatoCmsFileField.video cannot convert to OutputType the following string: 'DatoCmsAsset Video'" #91

Closed David-Richter closed 4 years ago

David-Richter commented 4 years ago

Hi there,

I just set up gatsby-source-datocms and when I run "gatsby develop" the following errors occur. It seems, that the error is not present in v2.1.18 but starts to occur in v2.1.19

error Plugin gatsby-source-datocms returned an error

TypeError: schema.buildEnumType is not a function

  • DatoCmsAsset.js:22 module.exports [website]/[gatsby-source-datocms]/hooks/sourceNodes/createTypes/upload/DatoCmsAsset.js:22:14

  • index.js:9 [website]/[gatsby-source-datocms]/hooks/sourceNodes/createTypes/upload/index.js:9:12

  • Array.forEach

  • index.js:8 module.exports [website]/[gatsby-source-datocms]/hooks/sourceNodes/createTypes/upload/index.js:8:30

  • index.js:17 [website]/[gatsby-source-datocms]/hooks/sourceNodes/createTypes/index.js:17:12

  • Array.forEach

  • index.js:16 module.exports [website]/[gatsby-source-datocms]/hooks/sourceNodes/createTypes/index.js:16:57

  • index.js:79 _callee2$ [website]/[gatsby-source-datocms]/hooks/sourceNodes/index.js:79:15

  • index.js:3 asyncGeneratorStep [website]/[gatsby-source-datocms]/hooks/sourceNodes/index.js:3:103

  • index.js:5 _next [website]/[gatsby-source-datocms]/hooks/sourceNodes/index.js:5:194

  • next_tick.js:68 process._tickCallback internal/process/next_tick.js:68:7

error UNHANDLED REJECTION

Error: DatoCmsFileField.video cannot convert to OutputType the following string: 'DatoCmsAsset Video'

  • TypeMapper.js:263 TypeMapper.convertOutputFieldConfig [website]/[graphql-compose]/lib/TypeMapper.js:263:17

  • configAsThunk.js:18 resolveOutputConfigAsThunk [website]/[graphql-compose]/lib/utils/configAsThunk.js:18:41

  • ObjectTypeComposer.js:284 ObjectTypeComposer.getFieldConfig [website]/[graphql-compose]/lib/ObjectTypeComposer.js:284:58

  • ObjectTypeComposer.js:445 getFieldNames.forEach.fieldName [website]/[graphql-compose]/lib/ObjectTypeComposer.js:445:23

  • Array.forEach

  • ObjectTypeComposer.js:444 ObjectTypeComposer.clone [website]/[graphql-compose]/lib/ObjectTypeComposer.js:444:26

  • add-inferred-fields.js:384 getSimpleFieldConfig [website]/[gatsby]/dist/schema/infer/add-inferred-fields.js:384:59

  • add-inferred-fields.js:197 getFieldConfig [website]/[gatsby]/dist/schema/infer/add-inferred-fields.js:197:19

  • add-inferred-fields.js:69 Object.keys.forEach.unsanitizedKey [website]/[gatsby]/dist/schema/infer/add-inferred-fields.js:69:17

  • Array.forEach

  • add-inferred-fields.js:67 addInferredFieldsImpl [website]/[gatsby]/dist/schema/infer/add-inferred-fields.js:67:30

  • add-inferred-fields.js:40 addInferredFields [website]/[gatsby]/dist/schema/infer/add-inferred-fields.js:40:3

  • index.js:40 addInferredType [website]/[gatsby]/dist/schema/infer/index.js:40:3

  • index.js:86 typeNames.map.typeName [website]/[gatsby]/dist/schema/infer/index.js:86:51

  • Array.map

  • index.js:86 addInferredTypes [website]/[gatsby]/dist/schema/infer/index.js:86:35

  • schema.js:139 [website]/[gatsby]/dist/schema/schema.js:139:11

  • Generator.next

matjack1 commented 4 years ago

@David-Richter thank you for reporting this, just for clarity, is this happening also with the latest version of our source plugin? Can you maybe send over at support@datocms.com the info on your DatoCMS project so that I can reproduce? Thank you!

David-Richter commented 4 years ago

@matjack1 thank your for your quick response. I sent you an email to support@datocms.com

matjack1 commented 4 years ago

This has been fixed over support.

guidolodetti commented 4 years ago

Hello! Same error for me on version 2.1.23. What was the fix?

David-Richter commented 4 years ago

My gatsby version was not the newest. It works in v2.18.21.

matjack1 commented 4 years ago

@guidolodetti let me know if it's still broken for you on latest versions of everything.

Thank you!