Skip to content

Make AsciiMath work with Vite #3122

@DanielJGeiger

Description

@DanielJGeiger

Issue Summary

Vite uses strict mode, so the usage of arguments.callee fails. Besides removing arguments.callee from the relevant JS files, Vite compatibility evidently requires slight changes to an additional AsciiMath JS file.

Steps to Reproduce:

See https://excalidraw-mcjzus0ve-excalidraw.vercel.app/ (source commit excalidraw/excalidraw@27a8cda) for an example of mathjax/MathJax-src#854 in use. In this deployment:

  1. Select "Math" in the toolbar.
  2. Type \(\alpha\) and press "Escape".
  3. Rendering fails with the browser console error "ReferenceError: MathJax is not defined", traced back to an AsciiMath JS file.

Technical Details:

  • MathJax Version: 3.2.2/4.0.0-beta.3
  • Client OS: Linux
  • Browser: Multiple

I am configuring and loading MathJax via loadMathJax() in src/element/subtypes/mathjax/implementation.tsx.

Supporting Information:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions