windmill-labs/windmill · error

Could not infer type of path ${JSON.stringify(parsed)}

Error message

Could not infer type of path ${JSON.stringify(parsed)}

What it means

getTypeStrFromPath extracts the item type from the path's final suffix; the suffix parsed from this path is not in the known list, so the sync engine cannot classify the file. Unlike the push-time error this fires during path scanning (loadPaths, compareDynFSElement).

Source

Thrown at cli/src/types.ts:469

    typeEnding === "http_trigger" ||
    typeEnding === "websocket_trigger" ||
    typeEnding === "kafka_trigger" ||
    typeEnding === "nats_trigger" ||
    typeEnding === "postgres_trigger" ||
    typeEnding === "mqtt_trigger" ||
    typeEnding === "amqp_trigger" ||
    typeEnding === "sqs_trigger" ||
    typeEnding === "gcp_trigger" ||
    typeEnding === "azure_trigger" ||
    typeEnding === "email_trigger" ||
    typeEnding === "user" ||
    typeEnding === "group" ||
    typeEnding === "settings" ||
    typeEnding === "encryption_key"
  ) {
    return typeEnding;
  } else {
    throw new Error("Could not infer type of path " + JSON.stringify(parsed));
  }
}

export function removeType(str: string, type: string) {
  // Normalize path for cross-platform compatibility and convert to forward slashes for API consistency
  const normalizedStr = path.normalize(str).replaceAll(SEP, "/");

  if (
    normalizedStr.endsWith("." + type + ".yaml") ||
    normalizedStr.endsWith("." + type + ".json")
  ) {
    return normalizedStr.slice(0, normalizedStr.length - type.length - 6);
  }
  // Accept clean paths without the type suffix (e.g. "f/folder/name" instead of "f/folder/name.schedule.yaml")
  if (normalizedStr.includes("." + type)) {
    log.debug(`Path '${str}' contains '.${type}' but doesn't end with '.${type}.(yaml|json)' — treating as clean path`);
  }
  return normalizedStr;

View on GitHub (pinned to e474e8803c)

Solutions

  1. Rename the file with a recognized type ending (e.g. .script.yaml, .flow.yaml, .resource.yaml, .variable.yaml, .schedule.yaml, .<kind>_trigger.yaml).
  2. Move non-sync files out of the wmill.yaml sync root.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/types.ts:469 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/b0bbcdf08024720f. Report an issue: GitHub.