Requiring vue-quill-editor/dist/ssr: document is not defined
See original GitHub issueOn vue-quill-editor 3.0.3, require vue-quill-editor/dist/ssr when rendering on server side results in
ReferenceError: document is not defined
at Object.DIFF_DELETE ([...]/foo/node_modules/quill/dist/quill.js:7450:21)
at __webpack_require__ ([...]/foo/node_modules/quill/dist/quill.js:36:30)
at Object.defineProperty.value ([...]/foo/node_modules/quill/dist/quill.js:975:1)
at __webpack_require__ ([...]/foo/node_modules/quill/dist/quill.js:36:30)
at Object.defineProperty.value ([...]/foo/node_modules/quill/dist/quill.js:4988:14)
at __webpack_require__ ([...]/foo/node_modules/quill/dist/quill.js:36:30)
at Object.defineProperty.value ([...]/foo/node_modules/quill/dist/quill.js:9832:13)
at __webpack_require__ ([...]/foo/node_modules/quill/dist/quill.js:36:30)
at Object.<anonymous> ([...]/foo/node_modules/quill/dist/quill.js:11344:18)
at __webpack_require__ ([...]/foo/node_modules/quill/dist/quill.js:36:30)
let VueQuillEditor
if(!Vue.prototype.$isServer) {
VueQuillEditor = require('vue-quill-editor')
} else {
VueQuillEditor = require('vue-quill-editor/dist/ssr')
}
Vue.use(VueQuillEditor)
Could you enlighten me if I’m missing something?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ReferenceError: document is not defined (in plain JavaScript)
When you are using server side rendering there is no browser. Hence, there will not be any variable window or document . Hence...
Read more >How to fix ReferenceError: Document is not defined ... - Sabe.io
The best way to resolve this is to just move your code to the bottom of the page so that the document will...
Read more >How to solve the document is not defined error - Flavio Copes
Here's how to fix the “referenceerror: document is not defined” error that you might have in Node.js or with a tool like Next.js....
Read more >Fix ReferenceError: document is not defined in JavaScript
This article covers the reasons why "ReferenceError: document is not defined" may arise and solutions to implement which can resolve them.
Read more >ReferenceError: document is not defined in JavaScript
js server-side application, and does not have access to the document object that is defined by the browser. For example, if you try...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s because of
var _quill = require('quill');
It uses documentI do not think you understand how webpack and ssr work together, so it’s hard to explain; all you need to know is that everything you have to do with SSR when using SSR rendering output.
In a program involving SSR rendering, you can not use components, you can only use
vue-quill-editor/dist/ssr