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

Throws on empty markdown fields in contentful #2067

Closed
brandonmp opened this issue Sep 9, 2017 · 1 comment
Closed

Throws on empty markdown fields in contentful #2067

brandonmp opened this issue Sep 9, 2017 · 1 comment

Comments

@brandonmp
Copy link
Contributor

I have an optional field on a Contentful type (with gatsby-source-contentful) that holds markdown.

When trying to run gatsby develop, nodes with an empty field break the build:

The new node didn't pass validation
ValidationError: child "internal" fails because [child "content" fails because ["content" is not allowed to be empty]]
{ id: 'c5YauqPb1uwSOy624aESCWodescriptionOverviewTextNode',
  parent: 'c5YauqPb1uwSOy624aESCWo',
  children: [],
  descriptionOverview: '',
  internal:
   { type: 'contentfulAgencyDescriptionOverviewTextNode',
     mediaType: 'text/markdown',
     content: '',
     contentDigest: 'd41d8cd98f00b204e9800998ecf8427e',
     owner: 'gatsby-source-contentful' } }

I thought the problem was from on-node-create in the source-contentful repo, but skipping createNode() when internal.content is empty doesn't fix the problem.

@KyleAMathews
Copy link
Contributor

Oh weird hapijs/joi#251

I'll PR a fix for this real quick.

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

2 participants