gatsbyjs/gatsby · error

LocalesMissing

LocalesMissing

Error message

Please check if your localeFilter is configured properly. Locales '${allLocales.map(item => item.code).join(`,`)}' were found but were filtered down to none.

What it means

Error "Please check if your localeFilter is configured properly. Locales '${allLocales.map(item => item.code).join(`,`)}' were found but were filtered down to none." thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby-source-contentful/src/source-nodes.js:174

  } = await fetchContent({ syncToken, pluginConfig, reporter })

  const contentTypeItems = await cache.get(CACHE_CONTENT_TYPES)

  const locales = allLocales.filter(pluginConfig.get(`localeFilter`))
  reporter.verbose(
    `Default locale: ${defaultLocale}. All locales: ${allLocales
      .map(({ code }) => code)
      .join(`, `)}`
  )
  if (allLocales.length !== locales.length) {
    reporter.verbose(
      `After plugin.options.localeFilter: ${locales
        .map(({ code }) => code)
        .join(`, `)}`
    )
  }
  if (locales.length === 0) {
    reporter.panic({
      id: CODES.LocalesMissing,
      context: {
        sourceMessage: `Please check if your localeFilter is configured properly. Locales '${allLocales
          .map(item => item.code)
          .join(`,`)}' were found but were filtered down to none.`,
      },
    })
  }

  // Update syncToken
  const nextSyncToken = currentSyncData?.nextSyncToken

  actions.setPluginStatus({
    [CACHE_SYNC_TOKEN]: nextSyncToken,
  })

  fetchActivity.end()

View on GitHub (pinned to 8b06340921)

Solutions

  1. Remove or fix the localeFilter option so at least one locale remains.
  2. Use one of the listed locale codes exactly (they are case-sensitive) in your localeFilter.

When it happens

Trigger: Thrown at packages/gatsby-source-contentful/src/source-nodes.js:174 when the library encounters an invalid state.

Common situations: Occurs when the localeFilter plugin option filters out every locale returned by the Contentful space. Adjust localeFilter in gatsby-config.js so at least one of the listed locales passes.


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/2cf74ca2c5f06360. Report an issue: GitHub.