-
Notifications
You must be signed in to change notification settings - Fork 905
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
Document is not defined Next 13 #910
Comments
Ok i have found the solution if you encapsulate your component into another think to import dynamically all the chain
My React Quill Component :
The other component : |
Hey, I just wonder how can your ReactQuill.register work cuz in my case it was undefined, the ReactQuill is a component. |
I am using this way and it works perfectly Quill.register("modules/imageResize", ImageResize); |
i did this but document is still not defined whenever i use Quill.register("modules/imageResize", ImageResize); |
please attach your code |
Document is not defined again. How can i fix this problem? "use client"; const ReactQuill = dynamic(() => import("react-quill"), { ssr: false }); import "../text-editor/text-editor.module.scss"; Quill.register("modules/imageResize", ImageResize); const Size = Quill.import("formats/size"); const Font = Quill.import("formats/font"); const modules = { const formats = [ export default function TextEditor({ value, handleChange, forwardedRef }) { useEffect(() => { return ( |
I have the same problem. The problem arises when I want to use The Size changer (let Size = Quill.import('formats/size'); ⨯ node_modules/quill/dist/quill.js (7661:11) @ document but without using the Size, there is no error. This is my code: "use client"; const ReactQuill = dynamic(() => import("react-quill"), { ssr: false }); export default function Home() { const [content, setContent] = useState(""); Size.whitelist = [ const quillModules = {
}; const quillFormats = [ const handleEditorChange = (newContent) => { return (
); |
I've had similar issues in the past. This is what fixed is for me. ` type Props = ReactQuillProps & { const ReactQuillWrapper = (props: Props) => { font.whitelist = fonts.map((x) => x.id); quill.register('modules/magicUrl', MagicUrl, true); ------- ReactQuillDynamicWrapper.tsx ------------ const ReactQuillDynamicWrapper = dynamic(() => import('./ReactQuillWrapper'), { export default ReactQuillDynamicWrapper; ` The solution is essentially to wrap all of the 'react-quill' setup code in it's own component, then import that component dynamically in NextJs |
Thanks a lot. Worked perfectly |
Why does this error occur ? Could someone help me understand it better ? Does react-quill not support ssr ? |
Then I import it on a form that is rendered also "use client"
but I have this error:
Originally posted by @MiguelMarroquin in #292 (comment)
I have the same problem of this guy .. If some one can help ?
The text was updated successfully, but these errors were encountered: