\DocumentMetadata{lang=ht} % or ff or blub
\documentclass{article}
\usepackage{babel}
\begin{document}
abc
\end{document}
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...rmessage LaTeX Error: Missing \protect \begin {document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help\@err@
l.4115 \bbl@read@ini{\bbl@bcp}\m@ne
If a language that is not known to babel is set in
\DocumentMetadatait errors. It doesn't matter if the language tag actually exists (in https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) or is completely wrong:gives