{"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/89620f09afcfef6b35e7bb8660132ab5b4d0cd3b/packages/vite/src/node/config.ts#L2363-L2399","documentation":"In loadConfigFromFile (config.ts:2376-2384), the configLoader parameter must be one of 'bundle', 'runner', or 'native'. Any other value throws. These select how the config file is loaded: bundled with esbuild, executed in a module runner, or natively imported.","triggerScenarios":"Passing an unsupported configLoader string via the JS API (loadConfigFromFile / createServer({ configLoader })) or CLI --configLoader flag, e.g. 'esm', 'require', or a typo like 'bundel'.","commonSituations":"Migrating from an older Vite with different loader names, typos in config, or passing a custom loader name that isn't supported.","solutions":["Use one of the accepted values: 'bundle' (default), 'runner', or 'native'.","Check for typos in the CLI flag or inline config option.","Leave configLoader unset to use the default 'bundle'."],"exampleFix":"// before\ncreateServer({ configLoader: 'esm' })\n// after\ncreateServer({ configLoader: 'bundle' })","handlingStrategy":"type-guard","validationCode":"const VALID_LOADERS = ['bundle', 'runner', 'native'] as const\nif (!VALID_LOADERS.includes(configLoader as any)) {\n  throw new Error(`Unsupported configLoader: ${configLoader}`)\n}","typeGuard":"function isConfigLoader(value: unknown): value is 'bundle' | 'runner' | 'native' {\n  return value === 'bundle' || value === 'runner' || value === 'native'\n}","tryCatchPattern":null,"preventionTips":["Type configLoader as the union 'bundle' | 'runner' | 'native' to catch typos at compile time.","Leave configLoader unset to accept the default 'bundle'.","Watch for typos when passing the CLI --configLoader flag."],"tags":["config","config-loader","validation"],"analyzedSha":"89620f09afcfef6b35e7bb8660132ab5b4d0cd3b","analyzedAt":"2026-08-03T19:28:02.920Z","schemaVersion":2}