Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-042: file type not allowed in spine

Updated:

EPUBCheck OPF-042 is an error message: “"…" is not a permissible spine media-type.” An EPUB 2 spine lists a file of a type that is never allowed in the spine, such as a stylesheet or an image. EPUBCheck names the media type; the spine is the reading order and only lists documents.

The official message

"%1$s" is not a permissible spine media-type.

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

  • An image added straight to the spine to show a full-page picture or a cover.
  • A stylesheet listed in the spine by a tool that added every file.
  • A spine copied from another book with different files.

How to fix it

  1. Find the itemref EPUBCheck points to.
  2. For an image, create an XHTML page that shows it (an img element) and put that page in the spine instead.
  3. For a stylesheet, remove the itemref; link the CSS from the XHTML documents instead.

When it's not this

If the spine item is another non-standard type without a fallback, EPUBCheck reports OPF-043.

Terms used here

Other OPF messages

  • OPF-041 Fallback-style item with id "…" could not be found.
  • OPF-043 Spine item with non-standard media-type "…" has no fallback.
  • OPF-040 Fallback item with id "…" could not be found.
  • OPF-044 Spine item with non-standard media-type "…" has no EPUB content document fallback.
  • OPF-045 Encountered circular reference in fallback chain.
  • OPF-037 Found deprecated media-type "…".

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck OPF-042 mean?

EPUBCheck OPF-042 is an error message: “"…" is not a permissible spine media-type.” An EPUB 2 spine lists a file of a type that is never allowed in the spine, such as a stylesheet or an image. EPUBCheck names the media type; the spine is the reading order and only lists documents.

Is OPF-042 an error?

OPF-042 is reported as error by default. 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.