EPUBCheck CSS-002: empty url() reference in CSS
Updated:
EPUBCheck CSS-002 is an error message: “Empty or NULL reference found.” The CSS has an empty reference, such as url() with nothing inside. An empty reference points nowhere, so reading apps cannot load anything from it, and EPUBCheck reports it as an error.
The official message
Empty or NULL reference found.
- 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
Typical causes
- A background or font URL removed without removing the declaration.
- A stylesheet generated from a template whose image or font path was never filled in.
How to fix it
- Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
- Delete the declaration with the empty url(), or fill in the path to a file that is in the EPUB.
- If you add a file, list it in the manifest with its media type.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If url() names a file that is not in the EPUB, the message is RSC-007.
Terms used here
Other CSS messages
CSS-001The "…" property must not be included in an EPUB Style Sheet.CSS-003CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.CSS-004CSS documents must be encoded in UTF-8, detected …;CSS-005Conflicting alternate style tags found: ….CSS-006CSS selector specifies fixed position.CSS-007Font-face reference "…" refers to non-standard font type "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.