{"record":{"id":"8d6bd11a25bdb9f2","repo":"vitejs/vite","slug":"unsupported-target-entry","errorCode":null,"errorMessage":"Unsupported target \"${entry}\"","messagePattern":"Unsupported target \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vite/src/node/plugins/css.ts","lineNumber":3652,"sourceCode":"    const index = entry.search(versionRE)\n    if (index >= 0) {\n      const browser = map[entry.slice(0, index)]\n      if (browser === false) continue // No mapping available\n      if (browser) {\n        const [major, minor = 0] = entry\n          .slice(index)\n          .split('.')\n          .map((v) => parseInt(v, 10))\n        if (!isNaN(major) && !isNaN(minor)) {\n          const version = (major << 16) | (minor << 8)\n          if (!targets[browser] || version < targets[browser]!) {\n            targets[browser] = version\n          }\n          continue\n        }\n      }\n    }\n    throw new Error(`Unsupported target \"${entry}\"`)\n  }\n\n  convertTargetsCache.set(esbuildTarget, targets)\n  return targets\n}\n\nexport function resolveLibCssFilename(\n  libOptions: LibraryOptions,\n  root: string,\n  packageCache?: PackageCache,\n): string {\n  if (typeof libOptions.cssFileName === 'string') {\n    return `${libOptions.cssFileName}.css`\n  } else if (typeof libOptions.fileName === 'string') {\n    return `${libOptions.fileName}.css`\n  }\n\n  const packageJson = findNearestMainPackageData(root, packageCache)?.data","sourceCodeStart":3634,"sourceCodeEnd":3670,"githubUrl":"https://github.com/vitejs/vite/blob/b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab/packages/vite/src/node/plugins/css.ts#L3634-L3670","documentation":"Thrown by `convertTargets` after ES-year expansion when iterating individual target entries: the entry is not `esnext`, does not match a known browser prefix in `map` (chrome, edge, firefox, ie, ios, node, opera, rhino, safari), or matches a browser `map` marks false (node, hermes, rhino) without further handling, or its version portion is unparseable. css.ts:3652 throws with the entry.","triggerScenarios":"After ES handling, line 3632 loops `entriesWithoutES`; for each entry it slices the alphabetic prefix and looks it up in `map`. If `map[prefix]` is undefined (unknown browser like 'deno', 'bun', 'chrome-android') or the entry's version digits do not parse, line 3652 throws.","commonSituations":"Setting `build.target: ['deno', 'bun', 'chrome107']`. Using a mobile/Android variant (`chrome-android`, 'safari-ios') not in the map. Typo (`firefo100`). Targets like `node18` (map marks node=false so they are skipped at 3637 only if matched; an unrecognized prefix falls through to 3652).","solutions":["Use only supported browser targets with version: chrome, edge, firefox, ie, ios, opera, safari (e.g. 'chrome110', 'safari16').","For node/rhino/hermes targets that map=false, ensure the prefix is recognized so they are skipped, or remove them.","Replace 'deno'/'bun'/'chrome-android' with their closest supported equivalents (e.g. 'chrome' for chromium-based).","Set `build.target: 'esnext'` or `'baseline-widely-available'` to avoid manual browser targeting.","Disable Lightning CSS (`css.transformer` default) if you must keep unsupported targets."],"exampleFix":"// before\nexport default defineConfig({\n  build: { target: ['deno', 'chrome107'] },\n})\n\n// after\nexport default defineConfig({\n  build: { target: ['chrome107', 'firefox110', 'safari16'] },\n})","handlingStrategy":"validation","validationCode":"const BROWSER_MAP = { chrome: true, edge: true, firefox: true, ie: true, ios: true, opera: true, safari: true, node: true, hermes: true, rhino: true }\nfunction assertBrowserTargets(target: string | string[]) {\n  for (const t of Array.isArray(target) ? target : [target]) {\n    if (t === 'esnext') continue\n    const m = /^([a-z]+)([\\d.]+)/.exec(t)\n    if (!m || !(m[1] in BROWSER_MAP)) throw new Error(`Unsupported target '${t}'; use chrome/edge/firefox/ie/ios/opera/safari with a version.`)\n  }\n}","typeGuard":"function isSupportedBrowserTarget(t: string): boolean {\n  if (t === 'esnext') return true\n  const m = /^([a-z]+)([\\d.]+)/.exec(t)\n  return !!m && ['chrome', 'edge', 'firefox', 'ie', 'ios', 'opera', 'safari', 'node', 'hermes', 'rhino'].includes(m[1])\n}","tryCatchPattern":"try {\n  await build()\n} catch (e) {\n  if (e instanceof Error && /Unsupported target/.test(e.message)) {\n    console.error('build.target has an unsupported browser entry; use chrome/edge/firefox/ie/ios/opera/safari with versions.')\n  }\n  throw e\n}","preventionTips":["Use supported browser prefixes (chrome, edge, firefox, ie, ios, opera, safari) with versions for build.target.","Avoid deno/bun/chrome-android targets under Lightning CSS; map them to supported equivalents.","Prefer 'baseline-widely-available' or 'esnext' to sidestep manual browser targeting."],"tags":["css","lightningcss","build-target","config"],"backgroundTag":null,"analyzedSha":"b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab","analyzedAt":"2026-08-11T11:49:19.515Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}