vueup / vue-quill

Rich Text Editor Component for Vue 3.
https://vueup.github.io/vue-quill/
MIT License
1.09k stars 264 forks source link

SSR with @vueup/vue-quill #487

Closed NicTorgersen closed 4 months ago

NicTorgersen commented 8 months ago

Version @vueup/vue-quill version 1.2.0

Describe the bug Using this package with SSR gives an error:

/var/www/html/node_modules/quill/dist/quill.js:7661
    var elem = document.createElement('div');
           ^
ReferenceError: document is not defined

To Reproduce Steps to reproduce the behavior:

  1. Install Laravel with Inertia and vite
  2. Set up SSR from Inertia docs: https://inertiajs.com/server-side-rendering
  3. Install @vueup/vue-quill
  4. vite build --ssr
  5. Set up component using the Vue Quill-package
  6. Run Laravel command to start ssr-server php artisan inertia:start-ssr

Expected behavior I would expect SSR to work using this package.

arffsaad commented 6 months ago

Can send a snippet of your component that is using quill? I'm using it but have to force it under CSR because document is strictly a client-only element.

For now my quill looks like this:

<ClientOnly>
        <div class="bg-white">
            <QuillEditor theme="snow" toolbar="minimal" />
        </div>
</ClientOnly>
stale[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.