{"record":{"id":"2cde4b2397a32cac","repo":"gatsbyjs/gatsby","slug":"10125","errorCode":"10125","errorMessage":"Your ${context.configName} file is in the wrong place. You've placed it in the src/ directory. It must instead be at the root of your site next to your package.json file.","messagePattern":"Your (.+?) file is in the wrong place\\. You've placed it in the src/ directory\\. It must instead be at the root of your site next to your package\\.json file\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/bootstrap/get-config-file.ts","lineNumber":157,"sourceCode":"      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) {\n    report.panic({\n      id: `10125`,\n      context: {\n        configName,\n      },\n    })\n  }\n\n  return uncompiledResult\n}\n\nasync function checkTsAndNearMatch(\n  siteDirectory: string,\n  configName: string,\n  distance: number\n): Promise<{\n  tsConfig: boolean\n  nearMatch: string\n}> {","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/bootstrap/get-config-file.ts#L139-L175","documentation":"Error \"Your ${context.configName} file is in the wrong place. You've placed it in the src/ directory. It must instead be at the root of your site next to your package.json file.\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby/src/bootstrap/get-config-file.ts:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the config file out of src/ to the site root, next to package.json"],"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-14T00:17:10.932Z"}