This implementation never worked, for two reasons: (1) The logic for getting the path to the katex package had invalid syntax in the version of Node we use. (2) The KaTeX package bundled by webpack doesn't seem to be importable from Node at all.
This fixes #7620.
Fixes #7480.
Co-authored-by: Reid Barton <rwbarton@gmail.com> Fixes #2056.