{"record":{"id":"d3e3e06135709754","repo":"gatsbyjs/gatsby","slug":"10124","errorCode":"10124","errorMessage":"It looks like you were trying to add the config file? Please rename \"${context.nearMatch}\" to \"${context.configName}.${context.isTSX ? `ts` : `js`}\"","messagePattern":"It looks like you were trying to add the config file\\? Please rename \"(.+?)\" to \"(.+?)\\.(.+?)\"","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/bootstrap/get-config-file.ts","lineNumber":138,"sourceCode":"    configName,\n    distance\n  )\n\n  // gatsby-config.ts exists but compiled gatsby-config.js does not\n  if (tsConfig) {\n    report.panic({\n      id: `10127`,\n      error,\n      context: {\n        configName,\n      },\n    })\n  }\n\n  // gatsby-config is misnamed\n  if (nearMatch) {\n    const isTSX = nearMatch.endsWith(`.tsx`)\n    report.panic({\n      id: `10124`,\n      error,\n      context: {\n        configName,\n        nearMatch,\n        isTSX,\n      },\n    })\n  }\n\n  // gatsby-config is incorrectly located in src directory\n  const isInSrcDir = await resolveJSFilepath({\n    rootDir: siteDirectory,\n    filePath: path.join(siteDirectory, `src`, configName),\n    warn: false,\n  })\n\n  if (isInSrcDir) {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/bootstrap/get-config-file.ts#L120-L156","documentation":"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.","triggerScenarios":"Thrown at packages/gatsby/src/bootstrap/get-config-file.ts:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the near-match file shown in context.nearMatch to the exact configName with a .ts or .js extension as indicated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}