# Titletoc not working with chapter?

I need to generate two separate lists of images in my document, so I want to use titletoc and \startist, \stoplist and \printlist commands. When I try to compile my document, I get an error:

! LaTeX Error: Something's wrong--perhaps a missing \item.


This is my minimal working example:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{titletoc}

\begin{document}

\part{First Part of this document}

\chapter{First}

\section{Introduction}
\startlist[test]{lof}

\begin{figure}[h]
\centering
\includegraphics[width=10cm]{picture.jpg}
\caption{Bla}
\label{fig:picture}
\end{figure}

\stoplist[test]{lof}

\printlist[test]{lof}{}{Pictures}

\end{document}


If I remove \chapter{First}, it works. What is the problem with chapter?

Welcome to TeX SX!

This is explained at the end of § 6.4 of the documentation (p.18). Based on this explanation, this code works:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\usepackage{titletoc}

\begin{document}

\part{First Part of this document}

\chapter{First}

\section{Introduction}
\startlist[test]{lof}

\begin{figure}[h]
\centering
\includegraphics[width=10cm]{picture.jpg}
\caption{Bla}
\label{fig:picture}
\end{figure}

\stoplist[test]{lof}