pageReady() error (?)

56 views
Skip to first unread message

Balint Toth

unread,
Jul 9, 2025, 6:29:55 AMJul 9
to MathJax Users
Hello there!

I've got the following code in my js:

   pageReady() {

MathJax.tex2mmlPromise(##SOME LATEX CODE (like newcommand...)##).then( () => {
return MathJax.startup.defaultPageReady().then(() => {

MathJax.typesetPromise().then(() => {

         ##SOME FUNCTION##

});

});
    });

}

I've use beta.7 and it worked liked charm.
Now with rc.4, this part of the code is broken, the console gives the following error:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'kind')

Am I doing something wrong or something has changed since beta.7?
I use Win 11 and Chrome.

Kind regards,
Balint

Davide Cervone

unread,
Jul 9, 2025, 8:53:29 AMJul 9
to mathja...@googlegroups.com
I can not reproduce the issue.  This page:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test of pageReady</title>
<script>
MathJax = {
  startup: {
    pageReady() {
      MathJax.tex2mmlPromise('\\newcommand{\\x}{x}').then(() => {
        return MathJax.startup.defaultPageReady().then(() => {
          MathJax.typesetPromise().then(() => {
            console.log('Promise complete');
          });
        });
      });
    }
  }
}
</script>
</head>
<script id="MathJax-script" defer src="https://cdn.jsdelivr.net/npm/mat...@4.0.0-rc.4/tex-chtml.js"></script>
<body>

$$\x+1$$

</body>
</html>

works as expected for me.  Can you provide a link to a live page that doesn't work for you?

I suspect it is not in the pageReady() function itself, but in MathJax.typesetPromise() call that is failing to process some piece of math in the page.  So without the actual page, it is not easy to tell what might be happening.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mathjax-users/96654b73-4a0e-45c1-be82-4ce1d221a57dn%40googlegroups.com.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages