# Titlesec Problem, Won't Compile [closed]

I came back to a .tex file I haven't used in a couple of years and it no longer compiles. I've narrowed down the problem to the titlesec package (I think); if I can find out why this MWE won't compile maybe I'll find my answer:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\usepackage{blindtext}

\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{2ex}{1ex}
\titlespacing{\subsection}{0pt}{1ex}{0ex}
\titlespacing{\subsubsection}{0pt}{0.5ex}{0ex}
\vspace{-1mm}

\begin{document}
\chapter{red}
\blindtext
\section{blue}
\blindtext
\subsection{green}
\blindtext
\subsubsection{yellow}

\end{document}


This is the error thrown:

test+001.tex:17: Missing number, treated as zero.
}
1.17 \section{blue}
?


If I add these lines the tex file compiles:

\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}


## closed as off-topic by Schweinebacke, Stefan Pinnow, TeXnician, Kurt, CarLaTeXAug 14 '17 at 19:04

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• What's \vspace{-1mm} supposed to do in the preamble? – egreg Aug 14 '17 at 9:57
• Using titlesec with the koma-script classes isn't recommended. – Bernard Aug 14 '17 at 10:09
• Compiles without error for me. Is your system up-to-date? – Ulrike Fischer Aug 14 '17 at 10:34
• There was a bug in titlesec once. Tryvto update that package. – Johannes_B Aug 14 '17 at 11:25
• I'm voting to close this question as off-topic because the error can be fixed by a simple update of classes and packages or upgrade of TeX Live. – Schweinebacke Aug 14 '17 at 17:30