# Server side rendering

**URL:** <https://jsonforms.discourse.group/t/server-side-rendering/223>\
**Category:** General\
**Created:** [October 13, 2020, 3:59pm UTC](https://jsonforms.discourse.group/t/server-side-rendering/223 "2020-10-13T15:59:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/discobot/32/3_2.png) [@discobot](https://jsonforms.discourse.group/u/discobot)\
**Post date:** [October 13, 2020, 3:59pm UTC](https://jsonforms.discourse.group/t/server-side-rendering/223/1 "2020-10-13T15:59:35Z")

</div>

Can json forms be used with server side rendering?

_[[original thread](https://spectrum.chat/jsonforms/general/server-side-rendering~e2f6d1af-b2a8-42a6-becc-201b414c35bf) by Stefan Čović]_

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [October 13, 2020, 4:06pm UTC](https://jsonforms.discourse.group/t/server-side-rendering/223/2 "2020-10-13T16:06:32Z")

</div>

In general yes (React). Some points to consider:

- At the moment we still have a `useLayoutEffect` in there which will throw a warning but you should be fine ignoring it for now. In the next major release (2.5.0) we will probably get rid of it.

- When your schema needs resolving you probably render a LoadingComponent so you might want to resolve already beforehand on the server.

- When rendering Material UI you need to make sure it works properly as some elements render different depending on their environment as there is no browser available on the server.

---

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/discobot/32/3_2.png) [@discobot](https://jsonforms.discourse.group/u/discobot)\
**Post date:** [October 14, 2020, 7:56am UTC](https://jsonforms.discourse.group/t/server-side-rendering/223/3 "2020-10-14T07:56:14Z")

</div>

_[Stefan Čović]_

Thank you

---

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/discobot/32/3_2.png) [@discobot](https://jsonforms.discourse.group/u/discobot)\
**Post date:** [October 14, 2020, 11:07am UTC](https://jsonforms.discourse.group/t/server-side-rendering/223/4 "2020-10-14T11:07:45Z")

</div>

_[Stefan Čović]_

When i import `jsonforms/react` , i get this error `Uncaught ReferenceError: process is not defined`, and my functions stop working on client, without importing from `jsonforms/react` everything seems to work fine, any idea?  
Also material-ui renderers wont render in browser, but vanilla renderers work

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [October 16, 2020, 9:55am UTC](https://jsonforms.discourse.group/t/server-side-rendering/223/5 "2020-10-16T09:55:47Z")

</div>

Hi @stefan-covic(stefan-covic), could you explain a bit more where and how this error occurs? Json Forms should work in any SSR rendering case.

Regarding Material UI I’m not surprised that they don’t render on the server side as Material UI’s reactive rendering expects certain media queries to be available. This is not the case by default in the server environment. We hit the same problem with our unit tests where we had to [manually add a `window` mock for them to render](https://github.com/eclipsesource/jsonforms/blob/bdd934f40c603be0b70e36bdd635891872d35f06/packages/material/test/renderers/MatchMediaMock.ts). You’ll have to provide something similar. Note that this is not an issue with JSON Forms but a feature of the Materal UI.
