-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MathJax v4 error: this.parent(...) is null #3130
Comments
There are several things happening, here, and the main issue is an error with how some promises are being handled internally. There is also a difference between v3 and v4 in how this is handled. It is important not to have two separate typeset operations going on simultaneously, because if the first one requires dynamically loaded code, it will pause and the second one will run during that pause, which can cause problems (for example, automatically assigned equation numbers can get out of order, or other global values can clash). Because In v4, with its new larger font coverage, not all the font data is loaded initially, and the use of some characters causes that data to be loaded dynamically. The double-struck characters (like What's happening in your case is that the first typeset identifies The documentation linked above suggests using the Because of the internal serialization in v4, your code should work, though in the reverse order of what you might expect. But there is a bug in () => typesetPromise(CONFIG.elements) : so that the One work-around for now would be of you to use pageReady: function () {
return MathJax.startup.defaultPageReady().then(() => MathJax.typesetPromise([document.body]));
} instead, since the Alternatively, you could do pageReady: function () {
MathJax.typesetPromise([document.body]);
return Promise.resolve();
} since the It's not clear to me what you are actually trying to accomplish with this If you want to have more precise control over the order in which things are typeset, it is probably best to set window.MathJax = {
startup: {
typeset: false,
pageReady: function () {
MathJax.typesetPromise([element1]);
MathJax.typesetPromise([element2]);
return MathJax.startup.defaultPageReady();
}
}
}; I will make a PR to fix the problem with the |
Proper handling of typesetPromise in defaultPageReady. (mathjax/MathJax#3130)
I'm loading MathJax in a simple HTML webpage, via jsdelivr
Firefox throws error at tex-mml-chtml.js line 1 column 41740:
Chrome also throws error:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'replaceChild')
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'replaceChild')
The text was updated successfully, but these errors were encountered: