{"record":{"id":"cbea14cedef0da08","repo":"Kong/insomnia","slug":"failed-to-update-param-input-param-is-invalid","errorCode":null,"errorMessage":"failed to update param: input `param` is invalid","messagePattern":"failed to update param: input `param` is invalid","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia-scripting-environment/src/objects/urls.ts","lineNumber":113,"sourceCode":"    return {};\n  }\n\n  override toString() {\n    const params = new UrlSearchParams();\n    params.append(this.key, this.value || '');\n\n    return params.toString();\n  }\n\n  toRawString() {\n    return `${this.key}=${this.value}`;\n  }\n\n  update(param: string | { key: string; value: string; type?: string }) {\n    if (typeof param === 'string') {\n      const paramObj = QueryParam.parseSingle(param);\n      if (!paramObj) {\n        throw new Error('failed to update param: input `param` is invalid');\n      }\n      this.key = typeof paramObj.key === 'string' ? paramObj.key : '';\n      this.value = typeof paramObj.value === 'string' ? paramObj.value : '';\n    } else if ('key' in param && 'value' in param) {\n      this.key = param.key;\n      this.value = param.value;\n      this.type = param.type;\n    } else {\n      throw new Error('the param for update must be: string | { key: string; value: string }');\n    }\n  }\n}\n\nexport interface UrlOptions {\n  id?: string;\n  auth?: {\n    username: string;\n    password: string;","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-scripting-environment/src/objects/urls.ts#L95-L131","documentation":"Defensive guard in QueryParam.update: the string form of the param was parsed but yielded a falsy result object, so there is nothing to copy key/value from. The input string is not a valid single query parameter.","triggerScenarios":"Thrown at packages/insomnia-scripting-environment/src/objects/urls.ts:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a 'key=value' string or an object with key/value fields","Validate the string before calling update()"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","contentChangedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}