windmill-labs/windmill · error

No resource matching file resource: ${path}.

Error message

No resource matching file resource: ${path}.

What it means

Thrown by findResourceFile during script/resource sync when a file resource reference declares a resource_file but no local candidate file matches it. Candidates are derived from the path (with extension variants) and filtered to entries that actually exist on disk via stat; zero survivors means the referenced file is missing or misnamed. Called by resourceFilePath and found while resolving local file resources for push; the faulting input is the resource's declared path.

Source

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

        return stat(x)
          .catch(() => undefined)
          .then((x) => x?.isFile())
          .then((e) => {
            return { path: x, file: e };
          });
      })
    )
  )
    .filter((x) => x.file)
    .map((x) => x.path);
  if (validCandidates.length > 1) {
    throw new Error(
      "Found two resource files for the same resource" +
        validCandidates.join(", ")
    );
  }
  if (validCandidates.length < 1) {
    throw new Error(`No resource matching file resource: ${path}.`);
  }
  return validCandidates[0];
}

// The separator is whatever the local filesystem uses, so both are accepted:
// on Windows these paths reach us as `my_script__mod\script.yaml`.
const MODULE_ENTRY_META_RE = /([\\/])script\.(yaml|json|lock)$/;

/**
 * Whether a path is a module folder's own metadata file (`__mod/script.yaml`).
 * `isModuleEntryPoint` already pins the file to `script.*` directly under
 * `__mod/`, so this only narrows it to the metadata extensions: a `script.yaml`
 * nested deeper in the module tree is a module file, not the script's metadata.
 */
export function isModuleEntryMetadata(p: string): boolean {
  return isModuleEntryPoint(p) && MODULE_ENTRY_META_RE.test(p);
}

View on GitHub (pinned to e474e8803c)

Solutions

  1. Create the missing resource file next to the item referencing it.
  2. Check the path spelling and the workspace- vs folder-relative layout expected by wmill sync.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at cli/src/commands/script/script.ts:289 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/05d425a321256b42. Report an issue: GitHub.