-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
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:
- Select "Math" in the toolbar.
- Type
\(\alpha\)
and press "Escape". - 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:
- Example of
arguments.callee
failing: https://excalidraw-k7bnvq58q-excalidraw.vercel.app/ (source commit excalidraw/excalidraw@dd50531). - Browser console error for
arguments.callee
: "Uncaught (in promise) TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them". - Omitting the change to
js/input/asciimath/mathjax2/input/AsciiMath.js
in excalidraw/excalidraw@27a8cda results in the browser console error "Uncaught (in promise) ReferenceError: global is not defined". - I have been using an extended version of delete arguments.callee MathJax-src#854 with
patch-package
in production on https://math.preview.excalidraw.com/ without issue. See excalidraw/excalidraw#7063 for the patch as I would submit it against the MathJax-srcdevelop
branch.
qria