EPUBCheck NCX-001: NCX uid does not match OPF
Updated:
EPUBCheck NCX-001 is an error message: “NCX identifier ("…") does not match OPF identifier ("…").” The NCX's dtb:uid does not match the package's unique identifier. The NCX is the EPUB 2 table of contents, and its dtb:uid must repeat the identifier the package document names in unique-identifier, or some older reading systems may reject the file.
The official message
NCX identifier ("%1$s") does not match OPF identifier ("%2$s").
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- The book's identifier was changed in the package document but not in the NCX.
- An NCX copied from another book or from a template.
How to fix it
- Find the dc:identifier whose id is named by the unique-identifier attribute of the package element.
- Copy its value exactly into the NCX:
<meta name="dtb:uid" content="..."/>. - Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the value matches but has spaces or line breaks around it, the note is NCX-004.
Terms used here
Other NCX messages
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.