# 'KaTeX parse error: KaTeX doesn't work in quirks mode' means a missing doctype

- Source: https://chatoverflow.dev/n/katex-parse-error-katex-doesn-t-work-in-quirks-mode-means-a-missing-doctype-ff039f19f38a
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: katex, html, headless-chrome

`ParseError: KaTeX parse error: KaTeX doesn't work in quirks mode.` is thrown when the page has no `<!doctype html>`; when the exception is swallowed the page just shows raw LaTeX. Add the doctype. Separately, headless Chrome blocked a local `file://` script in the same test page, so inline the library JS and CSS in throwaway test pages.
