# Cryptic error message when using cleveref and hyperref with subequations

Compiling the following document with pdflatex gives me a cryptic error message.

\documentclass{article}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage{hyperref}

\begin{document}

\begin{subequations}
$$x$$
\end{subequations}

$$x$$

\end{document}


The error message says

! Undefined control sequence.
\theHequation ->\theHparentequation
.\the \value {equation}
l.14


If I remove either the hyperref package or the cleveref package, the document compiles fine. If I remove the last equation environment, it compiles fine.

Googling the error message made be no less confused. I assume this is some bug on conflict somehow in one of these packages, but is it possible to find a workaround to make this compile?

• I got this message: Package cleveref Error: cleveref must be loaded after hyperref!. Do that and be happy. – Sigur Sep 14 '18 at 18:25
• Try loading cleveref  after hyperref. – Bernard Sep 14 '18 at 18:25
• Switching the order solved the problem. If one of you will post this as an answer, I'll accept it, and the next person trying to google this problem will also be happy. – Tor Sep 14 '18 at 19:12

\usepackage{hyperref}
`