concludio / react-mathlive

A react wrapper-component for mathlive.js
MIT License
25 stars 16 forks source link

Support for server side rendering? #23

Open digz6666 opened 3 years ago

digz6666 commented 3 years ago

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
ramon-adan commented 2 years ago

Any update regarding this?

arnog commented 2 years ago

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

Mopiel commented 9 months ago

We are using 0.77.0 and this is the output image

arnog commented 9 months ago

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