{"record":{"id":"83cbecc120b21540","repo":"remix-run/react-router","slug":"configresult-error","errorCode":null,"errorMessage":"${configResult.error}","messagePattern":"\\$\\{configResult\\.error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-router-dev/vite/rsc/plugin.ts","lineNumber":184,"sourceCode":"\n        configLoaderPromise ??= createConfigLoader({\n          rootDirectory,\n          mode,\n          watch,\n          validateConfig: (userConfig) => {\n            let errors: string[] = [];\n            if (userConfig.buildEnd) errors.push(\"buildEnd\");\n            if (userConfig.presets?.length) errors.push(\"presets\");\n            if (userConfig.serverBundles) errors.push(\"serverBundles\");\n            if (errors.length) {\n              return `RSC Framework Mode does not currently support the following React Router config:\\n${errors.map((x) => ` - ${x}`).join(\"\\n\")}\\n`;\n            }\n          },\n        });\n        configLoader = await configLoaderPromise;\n\n        const configResult = await configLoader.getConfig();\n        if (!configResult.ok) throw new Error(configResult.error);\n        updateConfig(configResult.value);\n\n        if (\n          viteUserConfig.base &&\n          config.basename !== \"/\" &&\n          viteCommand === \"serve\" &&\n          !viteUserConfig.server?.middlewareMode &&\n          !config.basename.startsWith(viteUserConfig.base)\n        ) {\n          throw new Error(\n            \"When using the React Router `basename` and the Vite `base` config, \" +\n              \"the `basename` config must begin with `base` for the default \" +\n              \"Vite dev server.\",\n          );\n        }\n\n        const vite = await import(\"vite\");\n        logger = vite.createLogger(viteUserConfig.logLevel, {","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/remix-run/react-router/blob/1fd704a7dabcbe3ae09d7387b460e6acaba30ec1/packages/react-router-dev/vite/rsc/plugin.ts#L166-L202","documentation":"Generic re-throw of a failed React Router config load inside the RSC Framework Mode plugin's config hook. The configResult comes from createConfigLoader with a validateConfig that rejects `buildEnd`, `presets`, and `serverBundles` (unsupported in RSC Framework Mode), but any other config-loading failure (parse error, invalid ssr/prepare, bad route config) surfaces here too. The interpolated message is the loader's structured error string.","triggerScenarios":"RSC Framework Mode (unstable_reactRouterRSC plugin) with a react-router.config.ts that sets buildEnd, presets, or serverBundles — the validateConfig callback returns a multi-line error listing the offending keys, which becomes this thrown message. Also any other !configResult.ok from the loader.","commonSituations":"Migrating a Framework Mode app to RSC Framework Mode without removing serverBundles (multiple server bundles aren't supported yet). Defining buildEnd hooks or presets that the RSC pipeline can't honor. Typos or schema violations in react-router.config.ts that fail config loading.","solutions":["Read the full interpolated message — it lists exactly which keys are unsupported (e.g. ` - serverBundles`).","Remove the unsupported keys (buildEnd, presets, serverBundles) from react-router.config.ts when using RSC Framework Mode.","Run `pnpm react-router typegen` / config validation to surface schema errors.","If you need serverBundles/buildEnd, stay on non-RSC Framework Mode until RSC support lands."],"exampleFix":"// react-router.config.ts\n// before (RSC Framework Mode)\nexport default { ssr: true, serverBundles: ({ branch }) => whichBundle(branch), buildEnd: async () => {} };\n// after — drop unsupported keys for RSC Framework Mode\nexport default { ssr: true };","handlingStrategy":"validation","validationCode":"// before enabling RSC Framework Mode, assert config is compatible\nimport userConfig from './react-router.config';\nconst unsupported = ['buildEnd', 'presets', 'serverBundles'].filter((k) => k in (userConfig as object));\nif (unsupported.length) throw new Error(`RSC Framework Mode does not support: ${unsupported.join(', ')}`);","typeGuard":"function isRscCompatibleConfig(c: { buildEnd?: unknown; presets?: unknown[]; serverBundles?: unknown }): boolean {\n  return !c.buildEnd && !c.presets?.length && !c.serverBundles;\n}","tryCatchPattern":"try { await viteBuild(); }\ncatch (e) {\n  if (e instanceof Error && e.message.startsWith('RSC Framework Mode does not currently support')) {\n    // remove the listed keys from react-router.config.ts and retry\n  }\n  throw e;\n}","preventionTips":["Audit react-router.config.ts for buildEnd/presets/serverBundles before switching to RSC Framework Mode.","Keep a non-RSC config branch if you depend on serverBundles."],"tags":["rsc","config","framework-mode","validation"],"backgroundTag":null,"analyzedSha":"1fd704a7dabcbe3ae09d7387b460e6acaba30ec1","analyzedAt":"2026-08-12T13:54:57.804Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}