pkra / mathjax-node-page

mathjax-node for pages
Apache License 2.0
42 stars 20 forks source link

* child_process in ./node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js #68

Closed blueshu closed 6 years ago

blueshu commented 6 years ago

When I try to add "import mjnode from 'mathjax-node-page'“ in my page , I got a error: This dependency was not found:

To install it, you can run: npm install --save child_process

Is this mean I should install child_process??

pkra commented 6 years ago

I'm afraid I can't reproduce the problem. Are you trying to bundle something for client-side use by any chance?

blueshu commented 6 years ago

I import it in nextJS project and it's worked on client side. I will test with a clean project

pkra commented 6 years ago

I import it in nextJS project and it's worked on client side.

Fascinating. I don't see how that could work given MathJax's custom module system.

But in a React context you might want to checkout the beta version of MathJax v3 -- it doesn't require a DOM but you can write a custom adaptor for whatever vdom you're using.

blueshu commented 6 years ago

ok, thanks

pkra commented 6 years ago

No problem. I didn't mention it but since v3 is written in Typescript, you can use it with any module format that TS supports -- none of which existed when MathJax's v2 module system was designed.