-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server side rendering broken since Sep 20th commits #122
Comments
You'll probably want to file this issue upstream with Quill. The calls to https://github.com/quilljs/quill/search?utf8=%E2%9C%93&q=document.createElement |
@alexkrolick is correct, Quill is tightly coupled to the browser at the moment. What could be done is to render only a |
I was able to work around this limitation by instantiating I imagine the maintainers of this module should be able to prevent calls to the DOM when it's not available, without too much trouble. Big +1 for that change. Here's my wrapper component to support isomorphic rendering:
|
Yes, ES6 modules are static. You can still probably detect
Not sure if we want to add support to the module directly - seems a bit too automagicky to me at the moment. |
All of my components are bundled up with WebPack and sent from the server using
My hack as above using |
this is how to check if it run in a browser or not (i changed a code from @calvintennant ):
|
I used |
I wrote this with dynamic module
|
I really liked the solution that @yalamber came up with, using |
This is the cleanest method I have found to import modules that use window or document:
|
this solution makes the situation what is re-rendering when onChange event performed |
thanks @bum-hyun. Do you have an example code on how to implement this module? Where do I import QuillNoSSRWrapper? |
You are right. But It is not working like textarea. How can ı pass form data via this editor. |
How about resize image ? I'm using quill-image-resize-module, but it's not working with NextJS. |
@Kamez you can try this solution. This worked for my application. In my eventform I had a field like this:
The component renderQuill has the following setup: renderQuill.js
As you notice I import a second component './renderQuillReact' that contains the resize module. renderQuillReact.js component
Hope this solution works for you! |
@frietkip Thank you very much. |
I am facing an error saying Can't read the property 'import' of undefined |
This is what i did works fine with SSR on next js import { SPLayout } from '@layout';
import dynamic from 'next/dynamic';
import { FC, ReactElement } from 'react';
const ReactQuill = dynamic(
() => {
return import('react-quill');
},
{ ssr: false }
);
const Create: FC = (): ReactElement => {
return (
<SPLayout>
<ReactQuill
value={'test'}
onChange={e => {
console.log(e);
}}
/>
</SPLayout>
);
};
export default Create; |
This is the best solution! @samlogan Thanks!! |
Not using next on my application, and this solution not worked for me. |
Same (nuxt3, SSR).. using ES modules, cant use require, and dynamic import() seems to be behaving strangely with a condition.. Just curious, why cant quill just do nothing if its not running in the client? |
Following solution works like a charm:
|
The text was updated successfully, but these errors were encountered: