gatsbyjs/gatsby · error

10124

10124

Error message

It looks like you were trying to add the config file? Please rename "${context.nearMatch}" to "${context.configName}.${context.isTSX ? `ts` : `js`}"

What it means

Fires from checkTsAndNearMatch when the exact config file was not found but a fuzzy near match exists in the site root (e.g. gatsby-configs.js): the distance-based name check concludes the config is simply misnamed and reports the exact rename needed.

Source

Thrown at packages/gatsby/src/bootstrap/get-config-file.ts:138

    configName,
    distance
  )

  // gatsby-config.ts exists but compiled gatsby-config.js does not
  if (tsConfig) {
    report.panic({
      id: `10127`,
      error,
      context: {
        configName,
      },
    })
  }

  // gatsby-config is misnamed
  if (nearMatch) {
    const isTSX = nearMatch.endsWith(`.tsx`)
    report.panic({
      id: `10124`,
      error,
      context: {
        configName,
        nearMatch,
        isTSX,
      },
    })
  }

  // gatsby-config is incorrectly located in src directory
  const isInSrcDir = await resolveJSFilepath({
    rootDir: siteDirectory,
    filePath: path.join(siteDirectory, `src`, configName),
    warn: false,
  })

  if (isInSrcDir) {

View on GitHub (pinned to e85d62f177)

Solutions

  1. Rename the near-match file shown in context.nearMatch to the exact configName with a .ts or .js extension as indicated
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby/src/bootstrap/get-config-file.ts:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/d3e3e06135709754. Report an issue: GitHub.