-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite + mathpix-markdown-it #278
Comments
@OlgaRedozubova I`m waiting feedback |
This occurs in the package we use to render the math. This is due to the fact that
You need to disable this for node-modules |
@OlgaRedozubova maybe you should add a patch for module "mathjax-full" inside your module? |
it's very important for us |
Hi, i've got a same problem too, and fixed it using
But now i got an error: "Uncaught SyntaxError: ambiguous indirect export: MathpixMarkdown". I need help please. |
I think the best solution here would be to disable strict mode.
MathJax has no plans to make these changes yet mathjax/MathJax#3122 (comment) I added such a patch in this branch This works inside In order for the patch for Creating a patch for
|
@OlgaRedozubova it is really work! thanks! |
npx patch-package mathjax-full • Creating temporary folder I need help when encountering this issue during patch installation. |
Same issue as above. I'm using Vite + React 18 MathJax 1.3.1 |
@OlgaRedozubova The patch helped with local development using, however, when I build it with Any ideas what causes the problem? |
I'm also experiencing this. Did you figure out how to solve this? @tomas-sipko
|
...
// Add the following four lines of code
if (typeof global.MathJax === 'undefined') {
global.MathJax = {};
}
MathJax = Object.assign(global.MathJax || {}, require("../xxx/MathJax.js").MathJax); // Modify the file reference path here
MathJax.xxx // The code where the error occurred
... I also encountered this problem. I referred to the patch solution above and modified the code where the error was reported. It worked successfully. |
@xvweimin I just got the same problem, but I did not understand your solution. Could you please expand the explanation? |
@enricobolzonello Have you followed the patch solution at #278 (comment) ? |
I know this is a bit old, but here's how I fixed the above First, make sure to define if (!window.MathJax) {
window.MathJax = {};
}
window.global = window;
Then, in the @@ -1,7 +1,1 @@ exports.MathJax = MathJax;
-var MathJax = {debug:true};
+MathJax = {debug:true};
-
-var window = {
- MathJax: MathJax
-};
-var navigator = {};
-var document = null; Also, MathJax is now on version 3.2.2, but this patch is specifically for version 3.0.1, so make sure you install the correct version with your package manager. |
Thanks for sharing. By the way, which mathpix markdown version are you using? |
@AFFFPupu I'm using For that error, it sounds like the Then, in the file The additions to the Hope this helps! |
@jdk2pq Thanks for your reply! It seemed that the two files are not correctly modified by me and after i added you lines, it now worked fine. Cheers! |
For anyone who encounters the error <!doctype html>
<html lang="en">
<head>
...
</head>
<body>
<div id="root"></div>
<script>
if (!window.MathJax) {
window.MathJax = {};
}
window.global = window;
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html> |
Hello.
I created vite project
npm create vite@latest
(react + typescript) (node 18.15.0)then i installed
"mathpix-markdown-it": "1.2.13"
then i used it in my project
and finally i saw error in console
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
how can i fix it?
The text was updated successfully, but these errors were encountered: