{"record":{"id":"eafc07c684a66435","repo":"facebook/docusaurus","slug":"config-file-at-siteconfigpath-not-found","errorCode":null,"errorMessage":"Config file at \"${siteConfigPath}\" not found.","messagePattern":"Config file at \"(.+?)\" not found\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus/src/server/config.ts","lineNumber":50,"sourceCode":"You can provide a custom config path with the code=${'--config'} option.\n    `);\n  }\n  return configPath;\n}\n\nexport async function loadSiteConfig({\n  siteDir,\n  customConfigFilePath,\n}: {\n  siteDir: string;\n  customConfigFilePath?: string;\n}): Promise<Pick<LoadContext, 'siteConfig' | 'siteConfigPath'>> {\n  const siteConfigPath = customConfigFilePath\n    ? path.resolve(siteDir, customConfigFilePath)\n    : await findConfig(siteDir);\n\n  if (!(await fs.pathExists(siteConfigPath))) {\n    throw new Error(`Config file at \"${siteConfigPath}\" not found.`);\n  }\n\n  const importedConfig = await loadFreshModule(siteConfigPath, {default: true});\n\n  const loadedConfig: unknown =\n    typeof importedConfig === 'function'\n      ? await importedConfig()\n      : await importedConfig;\n\n  const siteConfig = validateConfig(\n    loadedConfig,\n    path.relative(siteDir, siteConfigPath),\n  );\n  return {siteConfig, siteConfigPath};\n}\n","sourceCodeStart":32,"sourceCodeEnd":66,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus/src/server/config.ts#L32-L66","documentation":"Thrown by `loadSiteConfig` when a custom config file path was supplied (via `--config` or `customConfigFilePath`) but the resolved path does not exist on disk. Unlike error [137] (which auto-discovers), this fires only when the user explicitly named a config that is missing.","triggerScenarios":"Passing `--config <path>` where `<path>` resolves (relative to `siteDir`) to a non-existent file; setting a `customConfigFilePath` programmatically that points nowhere.","commonSituations":"Typo in the `--config` path; relative path resolved against the wrong cwd; config file moved/deleted; CI copying the wrong config path.","solutions":["Check the printed resolved path — it shows exactly what Docusaurus looked for.","Correct the `--config` argument to the actual file location (use an absolute path to remove ambiguity).","If you intended auto-discovery, drop `--config` entirely so `findConfig` runs.","Re-create or restore the config file if it should exist."],"exampleFix":"# before\ndocusaurus start --config configs/docusaurus.config.js  # path wrong\n# after\ndocusaurus start --config /abs/path/to/docusaurus.config.js","handlingStrategy":"validation","validationCode":"import fs from 'fs-extra';\nif (customConfigFilePath && !(await fs.pathExists(path.resolve(siteDir, customConfigFilePath)))) {\n  throw new Error(`Config not found: ${customConfigFilePath}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for `--config`.","Validate the path exists in a pre-flight step in CI.","Drop `--config` if you want auto-discovery."],"tags":["config","cli","filesystem"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}