You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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".
Currently, as you can see, the AsciiMath input jax has not been ported to a native v3 input jax, but instead loads the legacy v2 code and patches it in through some hacked shim code. The AsciiMath code needs to be ported to an actual v3 input jax so that the legacy v2 code can be dropped. This is one of the last remaining v2 pieces that needs to be moved to v3.
We are not planning to make changes to the legacy v2 code at this time, but appreciate the effort you have put into providing the changes you have made. I'm sure that will be useful to others who are having similar issues to yours.
Issue Summary
Vite uses strict mode, so the usage of
arguments.callee
fails. Besides removingarguments.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:
\(\alpha\)
and press "Escape".Technical Details:
I am configuring and loading MathJax via
loadMathJax()
in src/element/subtypes/mathjax/implementation.tsx.Supporting Information:
arguments.callee
failing: 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.js
in excalidraw/excalidraw@27a8cda results in the browser console error "Uncaught (in promise) ReferenceError: global is not defined".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.The text was updated successfully, but these errors were encountered: