question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gatsby-source-contentful fails to transform content

See original GitHub issue

Description

The issue is that when importing contentful from my space we get the error Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ . However, there is no content with this name, so I’m not sure what is causing this issue.

Environment

Gatsby version: v1.9.145 Node.js version: v9.3.0 Operating System: v10.13.2 (17C88)

File contents (if changed):

gatsby-config.js:

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
  },
  plugins: [
    {
      resolve: `gatsby-source-contentful`,
      options: {
        spaceId: `...`,
        accessToken: `...`,
        host: `preview.contentful.com`
      }
    },
    `gatsby-plugin-react-helmet`
  ]
}

Actual result

Fetch Contentful data: 32571.432ms
success source and transform nodes — 37.496 s
error UNHANDLED REJECTION


  Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "0___name" does not.

  - Array.map

  - create-sort-field.js:19 createSortField
    [marketing-website-gatsby]/[gatsby]/dist/schema/create-sort-field.js:19:20

  - build-node-connections.js:62
    [marketing-website-gatsby]/[gatsby]/dist/schema/build-node-connections.js:62:16

  - lodash.js:537 arrayEach
    [marketing-website-gatsby]/[lodash]/lodash.js:537:11

  - lodash.js:9359 Function.forEach
    [marketing-website-gatsby]/[lodash]/lodash.js:9359:14

  - build-node-connections.js:33 module.exports
    [marketing-website-gatsby]/[gatsby]/dist/schema/build-node-connections.js:33:5

  - index.js:42 _callee$
    [marketing-website-gatsby]/[gatsby]/dist/schema/index.js:42:25


error Command failed with exit code 1.

Expected behavior

Content should be imported and transformed cleanly.

Steps to reproduce

Other less-full spaces are fine, just this space 700+ entires, 1500+ assets, aren’t being imported cleanly.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
flaviolivolsicommented, Apr 24, 2018

I sent a pull request for this issue

1reaction
martimarkovcommented, Aug 16, 2018

I’m closing this issue. If the problem happens again feel free to open a new issue and link this one or reopen this one and ping me. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-source-contentful - npm
Gatsby source plugin for building websites using the Contentful CMS as a data source. Latest version: 8.3.0, last published: 16 hours ago.
Read more >
gatsby-source-contentful options error on build - Stack Overflow
You have to set your .env variables in Netlify with GATSBY_ prefix. So, your CONTENTFUL_ID variable will be GATSBY_CONTENTFUL_ID .
Read more >
Using Rich Text with the Contentful Source plugin
How to render and apply Rich Text fields with Gatsby and Contentful | Guide to querying Rich Text content with GraphQL.
Read more >
How to setup Gatsby with Contentful CMS and Deploy on Netlify
There, you will learn the fundamentals of Gatsby and GraphQL. You'll also learn how to source Gatsby markdown content from the filesystem. For...
Read more >
Gatsby Changelog | 5.3.0
Gatsby printed the complete contents of the page data to the terminal. ... DarthFloopy: chore(gatsby-source-contentful): Add note about RichTextField to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found