ProseMirror and Server Side Rendering

Hi! I need to transform my JSON structure from ProseMirror to HTML on the NodeJS server. What’s the best way to do it?

Right now I’m using

DOMSerializer.fromSchema(schema).serializeFragment(Node.fromJSON(schema, json))

But It doen’st work for a server because the “prosemirror-model” node module uses window

What can I do? Thanks

1 Like

Write your own serializer, or use a DOM library like JSDOM to pass a document option to DOMSerializer.

1 Like

I passed another document as the second parameter. Thank you so much for such foresight!