The problem:
When using NextJS and server-side-rendering (SSR) the program crashes because the window object is beeing accessed outside of useEffects.
Possible solutions/hacks:
Using dynamic imports. However this causes new problems becuase you need to have a ref to the editor. It is far from straight-forward how to get around this and I tried but it causes other problems such as callbacks not beeing called etc.
You can try following this guide to fix it:
https://github.com/vercel/next.js/issues/4957
Actual solution:
Make sure you only access the window/document object inside a useEffect
The problem: When using NextJS and server-side-rendering (SSR) the program crashes because the window object is beeing accessed outside of useEffects.
Possible solutions/hacks: Using dynamic imports. However this causes new problems becuase you need to have a ref to the editor. It is far from straight-forward how to get around this and I tried but it causes other problems such as callbacks not beeing called etc. You can try following this guide to fix it: https://github.com/vercel/next.js/issues/4957
Actual solution: Make sure you only access the window/document object inside a useEffect