gatsbyjs/gatsby · error

10127

10127

Error message

Your "${context.configName}.ts" file failed to compile to "${context.configName}.js". Please run "gatsby clean" and try again.

If the issue persists, please open an issue with a reproduction at https://gatsby.dev/new-issue for more help."

What it means

Error "Your "${context.configName}.ts" file failed to compile to "${context.configName}.js". Please run "gatsby clean" and try again. If the issue persists, please open an issue with a reproduction at https://gatsby.dev/new-issue for more help."" thrown in gatsbyjs/gatsby.

Source

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

      })
    }
  }

  if (uncompiledResult?.configFilePath) {
    return uncompiledResult
  }

  const error = new Error(`Cannot find package '${uncompiledConfigPath}'`)

  const { tsConfig, nearMatch } = await checkTsAndNearMatch(
    siteDirectory,
    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,

View on GitHub (pinned to e85d62f177)

Solutions

  1. Run `gatsby clean` to remove the stale cache so the .ts config is recompiled
  2. If it persists, open an issue with a reproduction at https://gatsby.dev/new-issue
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby/src/bootstrap/get-config-file.ts:126 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/5fe688b4e17afb8d. Report an issue: GitHub.