serhii.net

In the middle of the desert you can say anything you want

19 Jun 2024

Quarto error title.trim() is not a function in qmd front-matter YAML

ERROR: TypeError: title.trim is not a function quarto

happens for me when in front-matter I do

---
# title: "Publications and Awards"
title: {\{< var test >}}

instead of QUOTED

---
# title: "Publications and Awards"
title: "{\{< var test >}}"

ALSO, interestingly, when I save the wrong version while previewing the error is better:

ERROR: Validation of YAML front matter failed.
ERROR: In file publications.qmd
(line 3, columns 8--24) Field "title" has value {\{< var test >}}, which must insteadbe a string
2: # title: "Publications and Awards"
3: title: {\{< var test >}}
         ~~~~~~~~~~~~~~~~~
4: css: ./posts_publications/pub_style.css
✖ The value {\{< var test >}} is of type object.
ℹ The error happened in location title.

ERROR: Render failed due to invalid YAML.

So: quarto errors are more detailed when previewing instead of when compiling from zero? Interesting. Okay.

Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus