{"record":{"id":"b0bbcdf08024720f","repo":"windmill-labs/windmill","slug":"could-not-infer-type-of-path-json-stringify-pars","errorCode":null,"errorMessage":"Could not infer type of path ${JSON.stringify(parsed)}","messagePattern":"Could not infer type of path (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/types.ts","lineNumber":469,"sourceCode":"    typeEnding === \"http_trigger\" ||\n    typeEnding === \"websocket_trigger\" ||\n    typeEnding === \"kafka_trigger\" ||\n    typeEnding === \"nats_trigger\" ||\n    typeEnding === \"postgres_trigger\" ||\n    typeEnding === \"mqtt_trigger\" ||\n    typeEnding === \"amqp_trigger\" ||\n    typeEnding === \"sqs_trigger\" ||\n    typeEnding === \"gcp_trigger\" ||\n    typeEnding === \"azure_trigger\" ||\n    typeEnding === \"email_trigger\" ||\n    typeEnding === \"user\" ||\n    typeEnding === \"group\" ||\n    typeEnding === \"settings\" ||\n    typeEnding === \"encryption_key\"\n  ) {\n    return typeEnding;\n  } else {\n    throw new Error(\"Could not infer type of path \" + JSON.stringify(parsed));\n  }\n}\n\nexport function removeType(str: string, type: string) {\n  // Normalize path for cross-platform compatibility and convert to forward slashes for API consistency\n  const normalizedStr = path.normalize(str).replaceAll(SEP, \"/\");\n\n  if (\n    normalizedStr.endsWith(\".\" + type + \".yaml\") ||\n    normalizedStr.endsWith(\".\" + type + \".json\")\n  ) {\n    return normalizedStr.slice(0, normalizedStr.length - type.length - 6);\n  }\n  // Accept clean paths without the type suffix (e.g. \"f/folder/name\" instead of \"f/folder/name.schedule.yaml\")\n  if (normalizedStr.includes(\".\" + type)) {\n    log.debug(`Path '${str}' contains '.${type}' but doesn't end with '.${type}.(yaml|json)' — treating as clean path`);\n  }\n  return normalizedStr;","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/types.ts#L451-L487","documentation":"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).","triggerScenarios":"Thrown at cli/src/types.ts:469 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the file with a recognized type ending (e.g. .script.yaml, .flow.yaml, .resource.yaml, .variable.yaml, .schedule.yaml, .<kind>_trigger.yaml).","Move non-sync files out of the wmill.yaml sync root."],"exampleFix":null,"handlingStrategy":"validation","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"}