facebook/docusaurus · error · Error
Config file at "${siteConfigPath}" not found.
Error message
Config file at "${siteConfigPath}" not found. What it means
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.
Source
Thrown at packages/docusaurus/src/server/config.ts:50
You can provide a custom config path with the code=${'--config'} option.
`);
}
return configPath;
}
export async function loadSiteConfig({
siteDir,
customConfigFilePath,
}: {
siteDir: string;
customConfigFilePath?: string;
}): Promise<Pick<LoadContext, 'siteConfig' | 'siteConfigPath'>> {
const siteConfigPath = customConfigFilePath
? path.resolve(siteDir, customConfigFilePath)
: await findConfig(siteDir);
if (!(await fs.pathExists(siteConfigPath))) {
throw new Error(`Config file at "${siteConfigPath}" not found.`);
}
const importedConfig = await loadFreshModule(siteConfigPath, {default: true});
const loadedConfig: unknown =
typeof importedConfig === 'function'
? await importedConfig()
: await importedConfig;
const siteConfig = validateConfig(
loadedConfig,
path.relative(siteDir, siteConfigPath),
);
return {siteConfig, siteConfigPath};
}
View on GitHub (pinned to 3f483e80e3)
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.
Example fix
# before docusaurus start --config configs/docusaurus.config.js # path wrong # after docusaurus start --config /abs/path/to/docusaurus.config.js
Defensive patterns
Strategy: validation
Validate before calling
import fs from 'fs-extra';
if (customConfigFilePath && !(await fs.pathExists(path.resolve(siteDir, customConfigFilePath)))) {
throw new Error(`Config not found: ${customConfigFilePath}`);
} Prevention
- Use absolute paths for `--config`.
- Validate the path exists in a pre-flight step in CI.
- Drop `--config` if you want auto-discovery.
When it happens
Trigger: Passing `--config <path>` where `<path>` resolves (relative to `siteDir`) to a non-existent file; setting a `customConfigFilePath` programmatically that points nowhere.
Common situations: Typo in the `--config` path; relative path resolved against the wrong cwd; config file moved/deleted; CI copying the wrong config path.
Related errors
- No config file found in site dir code=${relativeSiteDir}.\nE
- Directory already exists at path=${dest}!
- ${pluginIdLogPrefix}: no docs found in path=${docsDir}.
- You specified ${source}, but file at path path=${filepath} c
- Invalid package manager choice ${packageManager}. Must be on
AI-assisted analysis of facebook/docusaurus@3f483e80e3 (2026-08-12).
Data as JSON: /api/errors/eafc07c684a66435.
Report an issue: GitHub.