{"record":{"id":"f8a122a985336c46","repo":"vitejs/vite","slug":"unsupported-configloader-configloader-accepte","errorCode":null,"errorMessage":"Unsupported configLoader: ${configLoader}. Accepted values are 'bundle', 'runner', and 'native'.","messagePattern":"Unsupported configLoader: (.+?)\\. Accepted values are 'bundle', 'runner', and 'native'\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vite/src/node/config.ts","lineNumber":2381,"sourceCode":"\nexport async function loadConfigFromFile(\n  configEnv: ConfigEnv,\n  configFile?: string,\n  configRoot: string = process.cwd(),\n  logLevel?: LogLevel,\n  customLogger?: Logger,\n  configLoader: 'bundle' | 'runner' | 'native' = 'bundle',\n): Promise<{\n  path: string\n  config: UserConfig\n  dependencies: string[]\n} | null> {\n  if (\n    configLoader !== 'bundle' &&\n    configLoader !== 'runner' &&\n    configLoader !== 'native'\n  ) {\n    throw new Error(\n      `Unsupported configLoader: ${configLoader}. Accepted values are 'bundle', 'runner', and 'native'.`,\n    )\n  }\n\n  const start = performance.now()\n  const getTime = () => `${(performance.now() - start).toFixed(2)}ms`\n\n  let resolvedPath: string | undefined\n\n  if (configFile) {\n    // explicit config path is always resolved from cwd\n    resolvedPath = path.resolve(configFile)\n  } else {\n    // implicit config file loaded from inline root (if present)\n    // otherwise from cwd\n    for (const filename of DEFAULT_CONFIG_FILES) {\n      const filePath = path.resolve(configRoot, filename)\n      if (!fs.existsSync(filePath)) continue","sourceCodeStart":2363,"sourceCodeEnd":2399,"githubUrl":"https://github.com/vitejs/vite/blob/b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab/packages/vite/src/node/config.ts#L2363-L2399","documentation":"loadConfigFromFile accepts a configLoader argument with exactly three valid values: 'bundle' (esbuild-bundle the config), 'runner' (module runner), and 'native' (native dynamic import). Any other value - including typos and legacy values - throws immediately before any file is loaded.","triggerScenarios":"Passing configLoader through the JS API or CLI (vite --configLoader=...) with an invalid string. Common after upgrading when a previously valid loader was renamed or removed.","commonSituations":"Upgrading Vite across versions where loader names changed; passing undefined explicitly; CLI scripts that template the loader name from CI variables.","solutions":["Use one of the three accepted values: 'bundle', 'runner', or 'native'.","If you did not intend to set it, omit configLoader entirely (defaults to 'bundle').","Check for typos when the value comes from an env var or CLI flag."],"exampleFix":"// before\nconst cfg = await loadConfigFromFile(env, file, root, log, 'bundler')\n// after\nconst cfg = await loadConfigFromFile(env, file, root, log, 'bundle')","handlingStrategy":"type-guard","validationCode":"const VALID = new Set(['bundle', 'runner', 'native']);\nfunction validateConfigLoader(loader) {\n  return VALID.has(loader) ? null : `Unsupported configLoader: ${loader}`;\n}","typeGuard":"function isConfigLoader(value) {\n  return value === 'bundle' || value === 'runner' || value === 'native';\n}","tryCatchPattern":null,"preventionTips":["Type configLoader as 'bundle' | 'runner' | 'native' in your wrappers.","Omit configLoader when you want the default rather than passing undefined strings."],"tags":["config","config-loader","api"],"backgroundTag":null,"analyzedSha":"b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab","analyzedAt":"2026-08-11T11:49:19.515Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}