windmill-labs/windmill · error · UnresolvableScriptContentFileError

${filePath} is not a script metadata file — no script file c

Error message

${filePath} is not a script metadata file — no script file can be resolved from it.

What it means

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.

Source

Thrown at cli/src/commands/script/script.ts:1155

  }
}

export async function findContentFile(filePath: string) {
  // Folder layout: __mod/script.yaml -> __mod/script.ts
  const isModuleFolderMeta = isModuleEntryMetadata(filePath);
  const toCandidate = (ext: string) =>
    isModuleFolderMeta
      ? filePath.replace(MODULE_ENTRY_META_RE, "$1script" + ext)
      : filePath.endsWith("script.json")
      ? filePath.replace(".script.json", ext)
      : filePath.endsWith("script.lock")
      ? filePath.replace(".script.lock", ext)
      : filePath.replace(".script.yaml", ext);
  // Every branch above is a no-op on a path that is neither flat nor
  // module-entry metadata, which would make toCandidate the identity function
  // and "resolve" the input to itself.
  if (!isModuleFolderMeta && !/\.script\.(yaml|json|lock)$/.test(filePath)) {
    throw new UnresolvableScriptContentFileError(
      `${filePath} is not a script metadata file — no script file can be resolved from it.`
    );
  }
  const candidates = exts.map(toCandidate);

  const validCandidates = (
    await Promise.all(
      candidates.map((x) => {
        return stat(x)
          .catch(() => undefined)
          .then((x) => x?.isFile())
          .then((e) => {
            return { path: x, file: e };
          });
      })
    )
  )
    .filter((x) => x.file)

View on GitHub (pinned to e474e8803c)

Solutions

  1. Pass a script metadata file such as <name>.script.yaml or <name>.script.json.
  2. Verify the file suffix; module-folder layouts must use the expected entry metadata name.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at cli/src/commands/script/script.ts:1155 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/1bd74d813b18175f. Report an issue: GitHub.