{"record":{"id":"1bd74d813b18175f","repo":"windmill-labs/windmill","slug":"filepath-is-not-a-script-metadata-file-no-scr","errorCode":null,"errorMessage":"${filePath} is not a script metadata file — no script file can be resolved from it.","messagePattern":"(.+?) is not a script metadata file — no script file can be resolved from it\\.","errorType":"exception","errorClass":"UnresolvableScriptContentFileError","httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":1155,"sourceCode":"  }\n}\n\nexport async function findContentFile(filePath: string) {\n  // Folder layout: __mod/script.yaml -> __mod/script.ts\n  const isModuleFolderMeta = isModuleEntryMetadata(filePath);\n  const toCandidate = (ext: string) =>\n    isModuleFolderMeta\n      ? filePath.replace(MODULE_ENTRY_META_RE, \"$1script\" + ext)\n      : filePath.endsWith(\"script.json\")\n      ? filePath.replace(\".script.json\", ext)\n      : filePath.endsWith(\"script.lock\")\n      ? filePath.replace(\".script.lock\", ext)\n      : filePath.replace(\".script.yaml\", ext);\n  // Every branch above is a no-op on a path that is neither flat nor\n  // module-entry metadata, which would make toCandidate the identity function\n  // and \"resolve\" the input to itself.\n  if (!isModuleFolderMeta && !/\\.script\\.(yaml|json|lock)$/.test(filePath)) {\n    throw new UnresolvableScriptContentFileError(\n      `${filePath} is not a script metadata file — no script file can be resolved from it.`\n    );\n  }\n  const candidates = exts.map(toCandidate);\n\n  const validCandidates = (\n    await Promise.all(\n      candidates.map((x) => {\n        return stat(x)\n          .catch(() => undefined)\n          .then((x) => x?.isFile())\n          .then((e) => {\n            return { path: x, file: e };\n          });\n      })\n    )\n  )\n    .filter((x) => x.file)","sourceCodeStart":1137,"sourceCodeEnd":1173,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L1137-L1173","documentation":"findContentFile was given a path that is not a recognized script metadata file (no .script.yaml/.script.json/.script.lock suffix and not a module-folder entry), so no content-file candidate can be derived from it.","triggerScenarios":"Thrown at cli/src/commands/script/script.ts:1155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a script metadata file such as <name>.script.yaml or <name>.script.json.","Verify the file suffix; module-folder layouts must use the expected entry metadata name."],"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"}