{"record":{"id":"ed6bb9f950ac902b","repo":"remix-run/react-router","slug":"reactrouterconfigfile-no-longer-exists","errorCode":null,"errorMessage":"${reactRouterConfigFile} no longer exists","messagePattern":"(.+?) no longer exists","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-router-dev/config/config.ts","lineNumber":459,"sourceCode":"async function resolveConfig({\n  root,\n  viteRunnerContext,\n  reactRouterConfigFile,\n  skipRoutes,\n  validateConfig,\n}: {\n  root: string;\n  viteRunnerContext: ViteRunner.Context;\n  reactRouterConfigFile?: string;\n  skipRoutes?: boolean;\n  validateConfig?: ValidateConfigFunction;\n}): Promise<ConfigResult> {\n  let reactRouterUserConfig: ReactRouterConfig = {};\n\n  if (reactRouterConfigFile) {\n    try {\n      if (!fs.existsSync(reactRouterConfigFile)) {\n        return err(`${reactRouterConfigFile} no longer exists`);\n      }\n\n      let configModule = await viteRunnerContext.runner.import(\n        reactRouterConfigFile,\n      );\n\n      if (configModule.default === undefined) {\n        return err(`${reactRouterConfigFile} must provide a default export`);\n      }\n\n      if (typeof configModule.default !== \"object\") {\n        return err(`${reactRouterConfigFile} must export a config`);\n      }\n\n      reactRouterUserConfig = configModule.default;\n\n      if (validateConfig) {\n        const error = validateConfig(reactRouterUserConfig);","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/remix-run/react-router/blob/6beaca39526d5716c3c112ebb0782765baa5a9ce/packages/react-router-dev/config/config.ts#L441-L477","documentation":"`readConfig` was invoked with an explicit `reactRouterConfigFile` path (typically by the dev server or a watcher that resolved it earlier), and `fs.existsSync` now reports the file is gone. The config layer returns this error instead of silently falling back to an empty config, so the dev server / build aborts until the file is restored.","triggerScenarios":"The react-router config file (e.g. `react-router.config.ts`) is deleted, moved, or renamed while the dev server is running; the path was resolved on a case-insensitive filesystem and then opened on a case-sensitive one; a git branch switch or clean removed the file mid-session.","commonSituations":"Deleting `react-router.config.ts` to 'start fresh' while `react-router dev` is still running; renaming the file (e.g. to `.js`) without restarting; editor/git operations during a long-running dev session; monorepo tooling that regenerates config files and briefly leaves them missing.","solutions":["Restore or recreate the config file at the exact path shown in the error message.","If you intentionally renamed it (e.g. `.ts` to `.js`), update the reference and restart the dev server.","Run `git status` to confirm the file wasn't removed by a branch switch or clean.","Restart `react-router dev` / `react-router build` once the file exists again."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import fs from \"node:fs\";\nconst CONFIG_FILE = \"react-router.config.ts\";\nif (!fs.existsSync(CONFIG_FILE)) {\n  throw new Error(`${CONFIG_FILE} is missing — restore it before running react-router`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep react-router.config.ts under version control so branch switches and cleans never strand you without it.","Avoid renaming the config file while the dev server is running; restart after any rename.","Pin the exact config path you pass to custom integrations instead of re-deriving it from stale state."],"tags":["config","dev-server","file-not-found","filesystem"],"backgroundTag":"missing-config-file","analyzedSha":"6beaca39526d5716c3c112ebb0782765baa5a9ce","analyzedAt":"2026-08-18T18:04:14.938Z","contentChangedAt":"2026-08-18T18:04:14.938Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}