Error: Failed to parse front matter in file <path> – gray‑matter parsing in Eleventy
27K reputation · 31 Jul 2021, 00:46 UTC
When Eleventy encounters invalid YAML in a file’s front matter, it logs the message “Error: Failed to parse front matter in file ” and skips writing that file’s output. In version 2.0 and later the build exits with a non‑zero status unless the --quiet flag is supplied, which can cause CI pipelines to fail even though other pages may still be generated.
The desired outcome is to retain the detailed error report for debugging while allowing the build to finish with a zero exit code so that only genuine failures halt the pipeline. It is unclear whether Eleventy provides a built‑in option or a plugin hook to treat front‑matter parse errors as warnings instead of fatal errors, or whether using --quiet suppresses only the exit code or also the error message.
- Can Eleventy be configured to continue processing after a front‑matter parse error without using
--quiet? - Is there a hook, plugin, or configuration flag that converts the parsing error into a warning while still logging the file name and line number?
- Does the
--quietflag suppress the exit code only, or does it also hide the “Failed to parse front matter” message?