{"record":{"id":"d2f551c9c280dacf","repo":"remix-run/remix","slug":"optionpath-key-is-not-a-supported-target","errorCode":null,"errorMessage":"${optionPath}.${key} is not a supported target","messagePattern":"(.+?)\\.(.+?) is not a supported target","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/assets/src/lib/target.ts","lineNumber":106,"sourceCode":"function normalizeScriptTargetObject(\n  target: AssetTarget | undefined,\n  optionPath: string,\n): NormalizedAssetTarget | undefined {\n  if (target == null) return undefined\n  if (!isPlainObject(target)) {\n    throw new TypeError(`${optionPath} must be an object`)\n  }\n\n  let normalizedTarget: NormalizedAssetTarget = {}\n\n  for (let [key, value] of Object.entries(target)) {\n    if (key === 'es') {\n      normalizedTarget.es = normalizeScriptTargetVersion(value, `${optionPath}.es`)\n      continue\n    }\n\n    if (!browserTargetNameSet.has(key)) {\n      throw new TypeError(`${optionPath}.${key} is not a supported target`)\n    }\n\n    normalizedTarget[key as BrowserTargetName] = normalizeBrowserTargetVersion(\n      value,\n      `${optionPath}.${key}`,\n    )\n  }\n\n  return Object.keys(normalizedTarget).length === 0 ? undefined : normalizedTarget\n}\n\nfunction normalizeStyleTargetObject(\n  target: AssetTarget | undefined,\n  optionPath: string,\n): NormalizedAssetTarget | undefined {\n  if (target == null) return undefined\n  if (!isPlainObject(target)) {\n    throw new TypeError(`${optionPath} must be an object`)","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/assets/src/lib/target.ts#L88-L124","documentation":"Inside the script target object, only known target keys are allowed: `es` plus recognized browser target names (chrome, firefox, safari, etc.). An unrecognized key throws with the offending key name so typos don't silently drop targets.","triggerScenarios":"Passing `{ target: { es2022: true } }`, `{ targt: ... }` typos, or non-browser keys like `{ node: 18 }` in script.target.","commonSituations":"Copy-pasting target config from esbuild (which accepts names like 'node' or version strings as keys); typos; using an outdated target name after a library update renamed it.","solutions":["Move ES version under the es key: { es: 2022 } instead of { es2022: true }","Remove non-browser keys like node — they are not supported here","Check the BrowserTargetName set in the docs/source for valid key names"],"exampleFix":"// before\nscript: { target: { es2020: true, node: 18 } }\n// after\nscript: { target: { es: 2020, chrome: '100' } }","handlingStrategy":"validation","validationCode":"const allowed = new Set(['es', 'chrome', 'firefox', 'safari', 'edge', 'ios', 'node' /* remove if unsupported */])\nfor (const key of Object.keys(target)) if (!allowed.has(key)) throw new Error('unsupported target: ' + key)","typeGuard":"function isSupportedTargetKey(key: string): boolean {\n  return key === 'es' || browserTargetNameSet.has(key)\n}","tryCatchPattern":null,"preventionTips":["Don't paste esbuild/browserslist keys verbatim","Enable strict TS types for target objects so unknown keys error at compile time"],"tags":["config","build","target","validation","assets","typo"],"backgroundTag":"invalid-option-value","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}