{"record":{"id":"2ecb408b5f390dd2","repo":"remix-run/remix","slug":"rmx-config-not-found-2ecb40","errorCode":"RMX_CONFIG_NOT_FOUND","errorMessage":"Could not find Remix configuration file: ${fromPath}","messagePattern":"Could not find Remix configuration file: (.+?)","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/remix-config.ts","lineNumber":137,"sourceCode":"  root: JsonNode | undefined\n  text: string\n}\n\n/**\n * Loads the nearest Remix project configuration or an explicitly selected config file.\n *\n * @param from A config file or directory from which to search upward for `remix.json`. Defaults to\n * `process.cwd()`.\n * @returns The validated Remix project configuration, or an empty object when no config is found.\n */\nexport async function loadConfig(from: string | URL = process.cwd()): Promise<RemixConfig> {\n  let fromPath = path.resolve(from instanceof URL ? fileURLToPath(from) : from)\n  let stat\n\n  try {\n    stat = await fs.stat(fromPath)\n  } catch (error) {\n    if (isNodeError(error) && error.code === 'ENOENT') throw remixConfigNotFound(fromPath)\n    throw error\n  }\n\n  if (stat.isFile()) {\n    return loadRemixConfig(path.dirname(fromPath), path.basename(fromPath))\n  }\n\n  if (!stat.isDirectory()) {\n    throw new TypeError(`Expected a Remix config file or directory: ${fromPath}`)\n  }\n\n  let configDir = await findAppRoot(fromPath, 'remix.json')\n  return configDir === null ? {} : loadRemixConfig(configDir, undefined)\n}\n\nexport async function loadRemixConfig(\n  cwd: string,\n  configPath: string | undefined,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/remix-config.ts#L119-L155","documentation":"loadConfig throws this when the path you passed (string or file URL) does not exist on disk (fs.stat fails with ENOENT). It is the entry point for locating the Remix configuration file, so a nonexistent path aborts immediately.","triggerScenarios":"Calling `loadConfig(from)` with a path or `file://` URL that does not exist; wrong relative path resolved against cwd; typo in the config file name.","commonSituations":"Running the CLI from the wrong working directory so a relative path like `./remix.config.ts` resolves incorrectly; CI checkout missing the config file.","solutions":["Verify the path exists: `ls` the exact resolved path","Pass an absolute path or a correct `file://` URL","Run the command from the project root where the config lives","Create the config file if the project genuinely needs one"],"exampleFix":"// before\nlet config = await loadConfig('./configs/remix.config.ts') // wrong dir\n// after\nlet config = await loadConfig(path.resolve(projectRoot, 'remix.config.ts'))","handlingStrategy":"validation","validationCode":"import { stat } from 'node:fs/promises'\nconst exists = await stat(configPath).then(() => true, () => false)\nif (!exists) throw new Error(`Config not found: ${configPath}`)","typeGuard":"const pathExists = async (p: string): Promise<boolean> =>\n  await stat(p).then(() => true, () => false)","tryCatchPattern":"catch (error) {\n  if (error instanceof Error && error.code === 'RMX_CONFIG_NOT_FOUND') {\n    // fall back to defaults or prompt for the config location\n  }\n  throw error\n}","preventionTips":["Resolve config paths against an explicit project root, not cwd","Check file existence before calling loadConfig in dynamic tooling"],"tags":["cli","config","file-not-found"],"backgroundTag":"config-file-not-found","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}