{"record":{"id":"3cbe1726e9bb6c12","repo":"windmill-labs/windmill","slug":"path-and-hash-are-mutually-exclusive-3cbe17","errorCode":null,"errorMessage":"path and hash_ are mutually exclusive","messagePattern":"path and hash_ are mutually exclusive","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"typescript-client/client.ts","lineNumber":173,"sourceCode":"  }\n  return await JobService.getRootJobId({ workspace, id: jobId });\n}\n\n/**\n * @deprecated Use runScriptByPath or runScriptByHash instead\n */\nexport async function runScript(\n  path: string | null = null,\n  hash_: string | null = null,\n  args: Record<string, any> | null = null,\n  verbose: boolean = false,\n  tag: string | null = null\n): Promise<any> {\n  console.warn(\n    \"runScript is deprecated. Use runScriptByPath or runScriptByHash instead.\"\n  );\n  if (path && hash_) {\n    throw new Error(\"path and hash_ are mutually exclusive\");\n  }\n  return _runScriptInternal(path, hash_, args, verbose, tag);\n}\n\nasync function _runScriptInternal(\n  path: string | null = null,\n  hash_: string | null = null,\n  args: Record<string, any> | null = null,\n  verbose: boolean = false,\n  tag: string | null = null\n): Promise<any> {\n  args = args || {};\n\n  if (verbose) {\n    if (path) {\n      console.info(`running \\`${path}\\` synchronously with args:`, args);\n    } else if (hash_) {\n      console.info(","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/typescript-client/client.ts#L155-L191","documentation":"Thrown by the deprecated runScript helper in the TypeScript client when both a path and a hash are passed. A job runs either the latest version at a path or one pinned immutable version by hash — the run API accepts exactly one target, so contradictory arguments are rejected before any request is made.","triggerScenarios":"Calling runScript(path, hash_, ...) with both arguments non-null.","commonSituations":"Refactoring code that had a hardcoded path but now also passes a hash variable; copying examples that show both parameters.","solutions":["Pass only the path argument","Pass only the hash_ argument","Prefer the non-deprecated runScriptByPath or runScriptByHash"],"exampleFix":"// before\nawait client.runScript('some/path', 'h-abc123', args)\n// after\nawait client.runScriptByPath('some/path', args)","handlingStrategy":"validation","validationCode":"if (path && hash_) throw new Error('pass either path or hash_, not both')","typeGuard":null,"tryCatchPattern":"try {\n  await client.runScript(path, hash_, args)\n} catch (e) {\n  if (e.message.includes('mutually exclusive')) {\n    console.error('Provide only one of path / hash_')\n  } else throw e\n}","preventionTips":[],"tags":["typescript","api-client","arguments","deprecated"],"backgroundTag":"mutually-exclusive-arguments","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}