From 515f1d150301392df9da7d4181ceaced583b5e16 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 16 Jul 2025 08:36:42 -0400 Subject: [PATCH] Make node-main init() wait for the startup promise to resolve --- components/mjs/node-main/node-main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/mjs/node-main/node-main.js b/components/mjs/node-main/node-main.js index 1649d277d..a2ebf6333 100644 --- a/components/mjs/node-main/node-main.js +++ b/components/mjs/node-main/node-main.js @@ -82,6 +82,7 @@ const init = (config = {}) => { combineConfig(MathJax.config, config); return Loader.load(...CONFIG.load) .then(() => CONFIG.ready()) + .then(() => MathJax.startup.promise) // Wait for MathJax to finish starting up .then(() => MathJax) // Pass MathJax global as argument to subsequent .then() calls .catch(error => CONFIG.failed(error)); }