{"record":{"id":"73418d354e5c018c","repo":"gatsbyjs/gatsby","slug":"fetchcontenttypes-73418d","errorCode":"FetchContentTypes","errorMessage":"Error fetching content types: ${createContentfulErrorMessage(e)}","messagePattern":"Error fetching content types: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-contentful/src/fetch.js","lineNumber":399,"sourceCode":"  const contentfulClientOptions = createContentfulClientOptions({\n    pluginConfig,\n    reporter,\n  })\n  const client = createClient(contentfulClientOptions)\n  const pageLimit = pluginConfig.get(`pageLimit`)\n  const sourceId = `${pluginConfig.get(`spaceId`)}-${pluginConfig.get(\n    `environment`\n  )}`\n  let contentTypes = null\n\n  try {\n    reporter.verbose(`Fetching content types (${sourceId})`)\n\n    // Fetch content types from CDA API\n    try {\n      contentTypes = await pagedGet(client, `getContentTypes`, pageLimit)\n    } catch (e) {\n      reporter.panic({\n        id: CODES.FetchContentTypes,\n        context: {\n          sourceMessage: `Error fetching content types: ${createContentfulErrorMessage(\n            e\n          )}`,\n        },\n      })\n    }\n    reporter.verbose(\n      `Content types fetched ${contentTypes.items.length} (${sourceId})`\n    )\n\n    contentTypes = contentTypes.items\n  } catch (e) {\n    handleContentfulError(e)\n  }\n\n  return contentTypes","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-source-contentful/src/fetch.js#L381-L417","documentation":"Error \"Error fetching content types: ${createContentfulErrorMessage(e)}\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-source-contentful/src/fetch.js:399 when the library encounters an invalid state.","commonSituations":"Occurs when fetching content types from Contentful fails. Verify spaceId/accessToken/environment in plugin options and network access to the Contentful API.","solutions":["Verify the Contentful access token can read content types in the configured environment.","Check the space ID and environment options, then retry the build."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}