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:
Issue Summary
Vite uses strict mode, so the usage of
arguments.calleefails. Besides removingarguments.calleefrom 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:
\(\alpha\)and press "Escape".Technical Details:
I am configuring and loading MathJax via
loadMathJax()in src/element/subtypes/mathjax/implementation.tsx.Supporting Information:
arguments.calleefailing: https://excalidraw-k7bnvq58q-excalidraw.vercel.app/ (source commit excalidraw/excalidraw@dd50531).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".js/input/asciimath/mathjax2/input/AsciiMath.jsin excalidraw/excalidraw@27a8cda results in the browser console error "Uncaught (in promise) ReferenceError: global is not defined".patch-packagein production on https://math.preview.excalidraw.com/ without issue. See excalidraw/excalidraw#7063 for the patch as I would submit it against the MathJax-srcdevelopbranch.