windmill-labs/windmill · error
Error parsing yaml ${path}
Error message
Error parsing yaml ${path} What it means
`yamlParseFile` reads a file and parses it as YAML with Windmill's custom tags. If reading or parsing fails for any reason, it wraps the original error with `Error parsing yaml <path>` (keeping the cause) so the failing file is identified.
Source
Thrown at cli/src/utils/yaml.ts:34
const inlineFilesetTag: ScalarTag = {
tag: "!inline_fileset",
resolve(value: string) {
return "!inline_fileset " + value;
},
};
const WINDMILL_CUSTOM_TAGS: ScalarTag[] = [inlineTag, inlineFilesetTag];
type YamlParseOptions = ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions;
export async function yamlParseFile(path: string, options: YamlParseOptions = {}) {
try {
return yamlParse(await readTextFile(path), {
...options,
customTags: [...WINDMILL_CUSTOM_TAGS, ...((options.customTags as ScalarTag[] | undefined) ?? [])],
});
} catch (e) {
throw new Error(`Error parsing yaml ${path}`, { cause: e });
}
}
export function yamlParseContent(
path: string,
content: string,
options: YamlParseOptions = {},
) {
try {
return yamlParse(content, {
...options,
customTags: [...WINDMILL_CUSTOM_TAGS, ...((options.customTags as ScalarTag[] | undefined) ?? [])],
});
} catch (e) {
throw new Error(`Error parsing yaml ${path}`, { cause: e });
}
}
View on GitHub (pinned to e474e8803c)
Solutions
- Inspect the `cause` for the exact parser line/column and fix the syntax (common: tabs instead of spaces, wrong indentation)
- Verify the file is UTF-8 encoded (readTextFile rejects UTF-16/32 and its errors get wrapped here)
- Validate locally before deploying: `yq . <path>` or a YAML linter; check the path exists
Example fix
// before (script.yaml) summary: x tabs cause parse error // after summary: x description: uses spaces
Defensive patterns
Strategy: try-catch
Validate before calling
const yaml = require('js-yaml');
try { yaml.load(require('fs').readFileSync(path, 'utf8')); }
catch (e) { throw new Error(`${path} is not valid YAML: ${e.message}`); } Try / catch
try {
const def = await yamlParseFile(path);
} catch (e) {
console.error(`YAML error in ${path}:`, e.cause ?? e);
// cause holds the original parser error with line/column details
} Prevention
- Use spaces, never tabs, for YAML indentation
- Lint YAML with a pre-commit hook (yamllint / `yq . file`)
- Keep files saved as UTF-8 (readTextFile rejects UTF-16/32 and its errors get wrapped here)
- Check the wrapped `cause` for the exact line/column before editing
When it happens
Trigger: Running commands that load YAML definitions (`wmill app`, `wmill script`/`runnable` from local files, `wmill lint raw-app`, local app flows) against a file with YAML syntax errors, tabs used for indentation, or an unsupported encoding thrown by `readTextFile`.
Common situations: Hand-edited YAML with bad indentation or duplicate keys; a file saved as UTF-16 by PowerShell; a nonexistent file path (read error wrapped too); windmill custom tags misused.
Related errors
- wmill-lock.yaml is malformed (expected an object). Refusing
- No `target` provided for the file. Please input a target pat
- Invalid value for `mode` permissions property on targeted fi
- Error parsing permission mode value {s}: {e}
- YAML parse error: {}
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/7f479d0aecd1be10.
Report an issue: GitHub.