Was: Document starts with dimension as text
I'm using pgfgantt in a file in a subdirectory, which is included using the standalone subpreambles feature. However, the textual value of a dimension is somehow being inserted right at the start of my document, and the document is failing to compile
main.tex:
\documentclass{report}
\usepackage[subpreambles=true]{standalone}
\begin{document}
Before
\input{main/gantt.tex}
\end{document}
main/gantt.tex:
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
vgrid={*1{dotted}},
x unit=4mm,
y unit chart=8mm,
y unit title=4mm,
time slot format=isodate-yearmonth,
time slot unit=month,
title height=1
]{2020-06}{2022-12}
\gantttitlecalendar{year}
\end{ganttchart}
\end{document}
Result of building main.tex:
l.3 \gtt@chartextrasize
{0}{0.4pt}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Overleaf's preview:
Why is 00.4pt appearing in the output? Where did it come from?
Edit: as pointed out in the comments, this failed to compile.
If I add \usepackage{pgfgantt} to main.tex, then the error and the dimension go away.
Why is this necessary?

! Undefined control sequence \gtt@chartextrasize{0 }{0.39998pt}– daleif Aug 11 '20 at 17:28[time slot format =isodate-yearmonth]if you use such dates? – Ulrike Fischer Aug 11 '20 at 17:29subpreamblesisn't actually working, as adding\usepackage{pgfgantt}to the main document fixes it. – Eric Aug 11 '20 at 17:34standalone? – Eric Aug 11 '20 at 17:50