{"record":{"id":"434ed40af18a6465","repo":"windmill-labs/windmill","slug":"runscriptasync-is-deprecated-use-runscriptbypatha","errorCode":null,"errorMessage":"runScriptAsync is deprecated. Use runScriptByPathAsync or runScriptByHashAsync instead.","messagePattern":"runScriptAsync is deprecated\\. Use runScriptByPathAsync or runScriptByHashAsync instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"typescript-client/client.ts","lineNumber":413,"sourceCode":"    if (p.startsWith(\"{\") || p.startsWith(\"[\")) return \"\";\n    // Strip type annotation (e.g. \"x: number\" -> \"x\", \"x?: string\" -> \"x\")\n    const colonIdx = p.indexOf(\":\");\n    if (colonIdx !== -1) p = p.slice(0, colonIdx);\n    return p.replace(/\\?$/, \"\").trim();\n  }).filter(Boolean);\n}\n\n/**\n * @deprecated Use runScriptByPathAsync or runScriptByHashAsync instead\n */\nexport async function runScriptAsync(\n  path: string | null,\n  hash_: string | null,\n  args: Record<string, any> | null,\n  scheduledInSeconds: number | null = null,\n  tag: string | null = null\n): Promise<string> {\n  console.warn(\n    \"runScriptAsync is deprecated. Use runScriptByPathAsync or runScriptByHashAsync instead.\"\n  );\n  // Create a script job and return its job id.\n  if (path && hash_) {\n    throw new Error(\"path and hash_ are mutually exclusive\");\n  }\n  return _runScriptAsyncInternal(path, hash_, args, scheduledInSeconds, tag);\n}\n\nasync function _runScriptAsyncInternal(\n  path: string | null = null,\n  hash_: string | null = null,\n  args: Record<string, any> | null = null,\n  scheduledInSeconds: number | null = null,\n  tag: string | null = null\n): Promise<string> {\n  // Create a script job and return its job id.\n  args = args || {};","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/typescript-client/client.ts#L395-L431","documentation":"console.warn from the deprecated runScriptAsync in the TS client: the method still queues the run and returns the job id, but runScriptByPathAsync / runScriptByHashAsync are the supported ways to launch a run asynchronously by explicit identifier.","triggerScenarios":"Thrown at typescript-client/client.ts:413 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace calls with runScriptByPathAsync or runScriptByHashAsync"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}