Server-side (Isomorphic) DOM maniuplation Node.js + Cheerio

786 Views Asked by At

I am writing an Isomorphic react application and I am running into server-side render errors such as document.querySelector is not a function or target.addEventListener is not a function when using certain external libraries.

From research, I gather that Cheerio is the best option for DOM manipulation on the server in NodeJS however figuring out correct implementation remains a problem.

Is Cheerio the right library to use and if so, how would I go about implementing this in my application?

1

There are 1 best solutions below

6
On

as far as I know it is not possible to run those commands from server side, those will need to be handle on clients side instead.

Best