react-mathlive icon indicating copy to clipboard operation
react-mathlive copied to clipboard

Support for server side rendering?

Open digz6666 opened this issue 4 years ago • 4 comments

It says document is not defined when used with server side rendering.

node_modules\mathlive\dist\mathlive.js:11955
     const gScriptUrl = (_b = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src) !== null && _b !== void 0 ? _b : getFileUrl();
[1]                        ^
[1]
[1] ReferenceError: document is not defined
[1]     at node_modules\mathlive\dist\mathlive.js:11955:24
[1]     at node_modules\mathlive\dist\mathlive.js:2:68

digz6666 avatar Mar 28 '21 10:03 digz6666

Any update regarding this?

ramon-adan avatar Apr 23 '22 18:04 ramon-adan

Note that this is fixed in the current version of MathLive (0.72.1).

arnog avatar Apr 23 '22 22:04 arnog

We are using 0.77.0 and this is the output image

Mopiel avatar Oct 23 '23 12:10 Mopiel

I would recommend trying the current version, with is 0.95.5.

arnog avatar Oct 23 '23 14:10 arnog