Server-Side Rendering
The component is SSR compatible. CodeMirror is only created in the browser (in onMounted), so during server rendering the component outputs its empty container element without touching window or document.
Nuxt 3 / Nuxt 4
Use the component directly:
Nuxt 2 or when problems occur
Wrap the component with <ClientOnly> so that it is rendered only in the browser:
Info
Because the editor is created after hydration, the instance properties (view, selection, …) are undefined on the server and until the ready event is emitted on the client.