{"record":{"id":"fde41c7338690301","repo":"windmill-labs/windmill","slug":"invalid-extension-path","errorCode":null,"errorMessage":"Invalid extension: + path","messagePattern":"Invalid extension: \\+ path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":1330,"sourceCode":" * Whether a path is a script's content file.\n *\n * Separators are normalized first: one \"extension\" is the path suffix\n * `__dbt/wm_dbt.yaml`, which on Windows is spelled `__dbt\\wm_dbt.yaml` and\n * would match nothing — silently skipping every dbt project on that platform.\n */\nexport function hasScriptExt(p: string): boolean {\n  const norm = p.replaceAll(\"\\\\\", \"/\");\n  return exts.some((ext) => norm.endsWith(ext));\n}\n\nexport function removeExtensionToPath(path: string): string {\n  const norm = path.replaceAll(\"\\\\\", \"/\");\n  for (const ext of exts) {\n    if (norm.endsWith(ext)) {\n      return path.substring(0, path.length - ext.length);\n    }\n  }\n  throw new Error(\"Invalid extension: \" + path);\n}\n\nasync function list(\n  opts: GlobalOptions & {\n    showArchived?: boolean;\n    includeWithoutMain?: boolean;\n    includeDraftOnly?: boolean;\n    json?: boolean;\n  }\n) {\n  if (opts.json) log.setSilent(true);\n  const workspace = await resolveWorkspace(opts);\n  await requireLogin(opts);\n\n  let page = 0;\n  const perPage = 10;\n  const total: Script[] = [];\n  while (true) {","sourceCodeStart":1312,"sourceCodeEnd":1348,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L1312-L1348","documentation":"removeExtensionToPath could not strip any known script extension from the given path: the path does not end with any recognized script content-file suffix, so it is not a script content file this function can handle.","triggerScenarios":"Thrown at cli/src/commands/script/script.ts:1330 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a path ending in a recognized script extension (.ts, .py, .script.yaml, ...).","Check that the file was not renamed to an unknown suffix."],"exampleFix":null,"handlingStrategy":"type-guard","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"}