{"record":{"id":"054b842cb17316f0","repo":"vuejs/vue-cli","slug":"url-and-path-can-t-be-defined-at-the-same-time","errorCode":null,"errorMessage":"'url' and 'path' can't be defined at the same time.","messagePattern":"'url' and 'path' can't be defined at the same time\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@vue/cli-ui/apollo-server/api/PluginApi.js","lineNumber":247,"sourceCode":"   * Used to load components and add vue-router routes.\n   *\n   * @param {object} options Client addon options\n   *   {\n   *     id: string,\n   *     url: string\n   *   }\n   *   or\n   *   {\n   *     id: string,\n   *     path: string\n   *   }\n   */\n  addClientAddon (options) {\n    if (this.lightMode) return\n    try {\n      validateClientAddon(options)\n      if (options.url && options.path) {\n        throw new Error('\\'url\\' and \\'path\\' can\\'t be defined at the same time.')\n      }\n      this.clientAddons.push({\n        ...options,\n        pluginId: this.pluginId\n      })\n    } catch (e) {\n      logs.add({\n        type: 'error',\n        tag: 'PluginApi',\n        message: `(${this.pluginId || 'unknown plugin'}) 'addClientAddon' options are invalid\\n${e.message}`\n      }, this.context)\n      console.error(new Error(`Invalid options: ${e.message}`))\n    }\n  }\n\n  /* Project view */\n\n  /**","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/vuejs/vue-cli/blob/7eb93c169c7520935252e2473387f923ef80d856/packages/@vue/cli-ui/apollo-server/api/PluginApi.js#L229-L265","documentation":"In vue-cli-ui, PluginApi.addClientAddon registers a client addon either by dev-server `url` or by local bundle `path`. The two are mutually exclusive because each fully specifies how to load the addon; defining both is ambiguous and is rejected before the addon is pushed.","triggerScenarios":"A UI plugin calling `api.addClientAddon({ id, url, path })` with both `url` and `path` set.","commonSituations":"Copy-pasting an addon options object that carried both fields; leftover dev `url` while also pointing at a built `path`.","solutions":["Provide only `url` (dev server) or only `path` (local bundle), not both.","Conditionally pick one based on NODE_ENV."],"exampleFix":"// before\napi.addClientAddon({ id: 'foo', url: 'http://localhost:8080', path: './dist' })\n// after\nconst isDev = process.env.NODE_ENV !== 'production'\napi.addClientAddon(isDev ? { id: 'foo', url: 'http://localhost:8080' } : { id: 'foo', path: './dist' })","handlingStrategy":"type-guard","validationCode":"if (options.url && options.path) {\n  throw new Error(\"addClientAddon: provide 'url' or 'path', not both\")\n}","typeGuard":"const isExclusiveAddonSource = (o) => !(o.url && o.path)","tryCatchPattern":"try { api.addClientAddon(options) } catch (e) { /* drop one of url/path based on env, then retry */ }","preventionTips":["Pick url (dev) or path (built bundle) per environment, never both.","Build the addon options object from a single source field."],"tags":["cli-ui","plugin","configuration"],"backgroundTag":null,"analyzedSha":"7eb93c169c7520935252e2473387f923ef80d856","analyzedAt":"2026-08-13T10:13:37.803Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}