Hyperref stopped working abruptly

compilation errorerrorsmiktextexstudio

An avid user of hyperref package here. I had been using it for almost all of my documents, and it had been working just fine, until today, when all of a sudden, all my files that have

\usepackage{hyperref}

in them, began showing this error while compiling:

File `uniquecounter.sty' not found. \RequirePackage{uniquecounter}[2009/12/18]

What could be causing the problem here? How can I fix that?


I use TeXstudio and MiKTex on Windows 11. I did not do any tinkering (reinstalling, updating, etc.) with these before or after the error appeared.


Minimum example that illustrates my problem:

\documentclass{article}
\usepackage{hyperref}

\begin{document}
    \section{Section 1}\label{sec 1}
    In Section \ref{sec 1}, ...
\end{document}

The log file:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.3) (preloaded format=pdflatex 2022.3.31)  6 APR 2022 17:53
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**./texstudio_KwQAVn.tex
(texstudio_KwQAVn.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\hyperref
.sty
Package: hyperref 2022-02-21 v7.00n Hypertext links for LaTeX

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/ltxcmds\ltxcmds
.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/iftex\iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pdftexcmds\pdft
excmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/infwarerr\infwa
rerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics\keyval.s
ty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/kvsetkeys\kvset
keys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/kvdefinekeys\kv
definekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pdfescape\pdfes
cape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hycolor\hycolor.s
ty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/letltxmacro\letlt
xmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/auxhook\auxhook.s
ty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/kvoptions\kvoptio
ns.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\@linkdim=\dimen139
\Hy@linkcounter=\count193
\Hy@pagecounter=\count194

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\pd1enc.d
ef
File: pd1enc.def 2022-02-21 v7.00n Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
... no UTF-8 mapping file for font encoding PD1
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/intcalc\intcalc
.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
)
(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/etexcmds\etexcm
ds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy@SavedSpaceFactor=\count195

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\puenc.de
f
File: puenc.def 2022-02-21 v7.00n Hyperref: PDF Unicode definition (HO)
Now handling font encoding PU ...
... no UTF-8 mapping file for font encoding PU
)
Package hyperref Info: Hyper figures OFF on input line 4137.
Package hyperref Info: Link nesting OFF on input line 4142.
Package hyperref Info: Hyper index ON on input line 4145.
Package hyperref Info: Plain pages OFF on input line 4152.
Package hyperref Info: Backreferencing OFF on input line 4157.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4390.
\c@Hy@tempcnt=\count196
 (C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/url\url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 4749.
\XeTeXLinkMargin=\dimen140

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/bitset\bitset.s
ty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/generic/bigintcalc\bigi
ntcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO
)
))
\Fld@menulength=\count197
\Field@Width=\dimen141
\Fld@charsize=\dimen142
Package hyperref Info: Hyper figures OFF on input line 6027.
Package hyperref Info: Link nesting OFF on input line 6032.
Package hyperref Info: Hyper index ON on input line 6035.
Package hyperref Info: backreferencing OFF on input line 6042.
Package hyperref Info: Link coloring OFF on input line 6047.
Package hyperref Info: Link coloring with OCG OFF on input line 6052.
Package hyperref Info: PDF/A mode OFF on input line 6057.
LaTeX Info: Redefining \ref on input line 6097.
LaTeX Info: Redefining \pageref on input line 6101.

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\atbegshi-ltx
.sty
Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
)
\Hy@abspage=\count198
\c@Item=\count199
\c@Hfootnote=\count266
)
Package hyperref Info: Driver (autodetected): hpdftex.

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\hpdftex.
def
File: hpdftex.def 2022-02-21 v7.00n Hyperref driver for pdfTeX

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\atveryend-lt
x.sty
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atveryend pac
kage
with kernel methods
)
\Fld@listcount=\count267
\c@bookmark@seq@number=\count268

(C:\Users\Sarthak\AppData\Local\Programs\MiKTeX 2.9\tex/latex/rerunfilecheck\re
runfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)


! LaTeX Error: File `uniquecounter.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.271 \RequirePackage{uniquecounter}[2009/12/18]
                                                ^^M
*** (cannot \read from terminal in nonstop modes)

 
Here is how much of TeX's memory you used:
 6737 strings out of 478571
 105054 string characters out of 2841014
 392036 words of memory out of 3000000
 24928 multiletter control sequences out of 15000+600000
 469259 words of font info for 28 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 59i,0n,63p,199b,36s stack positions out of 10000i,1000n,20000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

Best Answer

For an unknown reason you lost the uniquecounter package. Install/reinstall it in the miktex console.