Destination with the same identifier (name{page.}) has been already used, duplicate ignored warning

fancyhdrhyperrefpdftexwarnings

Consider this test case:

\documentclass{article}
\usepackage{hyperref}


\usepackage{fancyhdr}
\fancypagestyle{empty}{
   \pagenumbering{gobble}
}


\usepackage{titling}
\title{}
\author{}


\begin{document}
\pagestyle{empty}
\maketitle
\newpage


\textit{this page intentionally left blank}
\end{document}

It yields the warning:

destination with the same identifier (name{page.}) has been already used, duplicate ignored<to be read again> \relax l.24 \end{document} [2] (test.aux)

which presumably relate to a clash between hyperref and fancyhdr packages.

Is there any solution to fix this warning without loosing or disabling functionality?

An unrelated question: What is a reason, that fancyhdr breaks empty page style, so have to use gobble to make it work as expected? Can this be fixed by package options or something?

UPDATE 1:

Following Pieter van Oostrum and Ulrike Fischer suggestions, I dropped the use of gobble in favor of \thispagestyle{empty}, and it solved warning above. Thank you!

Unfortunately on a next step with defining style for main part of document (which goes after the ToC and prior appendices):

\documentclass{article}
\usepackage[headheight=30pt]{geometry}
\usepackage{hyperref}
\usepackage{fancyhdr}
\fancypagestyle{stylemain}{
    \pagenumbering{arabic}
}

\usepackage{titling}
\title{}
\author{}

\begin{document}
\pagestyle{empty}
\maketitle
\thispagestyle{empty}
\newpage

\textit{this page intentionally left blank}
\newpage

\pagestyle{stylemain}
test
\end{document}

I got similar warning:

destination with the same identifier (name{page.1}) has been already used, duplicate ignored<to be read again> \relax l.24 \end{document} [1] (test.aux)

I have to use arabic page numbering, since need to switch from roman used in ToC, so cannot drop it as gobble above. Can this warning be fixed without dropping arabic?

While looking on similar issues found hypertexnames=false option for hyperref package as workaround. It solves warnings for both test cases above without additional changes. But according to the hyperref documentation it is rather a hack to hide warnings, not to solve them. What are the consequences of its use while not solving warnings in essence?

Best Answer

\maketitle contains a \thispagestyle{plain} which overwrites the empty page style.

You can overwrite it by another \thispagestyle{empty}:

\documentclass{article}
\usepackage{hyperref}
\usepackage{fancyhdr}

\usepackage{titling}
\title{}
\author{}


\begin{document}
\pagestyle{empty}
\maketitle
\thispagestyle{empty}
\newpage


\textit{this page intentionally left blank}
\end{document}