-
Notifications
You must be signed in to change notification settings - Fork 97
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
nuxt 3 error: document is not defined #68
Comments
I had the same problem, but I solved it. // components/QuillEditorWrapper.client.vue <-- important!
<template>
<QuillEditor :modules="modules" toolbar="full" />
</template>
<script>
import ImageUploader from "quill-image-uploader";
export default {
setup: () => {
const modules = {
name: "imageUploader",
module: ImageUploader,
options: {
upload: (file) => {
return new Promise((resolve, reject) => {
const formData = new FormData();
formData.append("image", file);
$fetch
.post("/upload-image", formData)
.then((res) => {
console.log(res);
resolve(res.data.url);
})
.catch((err) => {
reject("Upload failed");
console.error("Error:", err);
});
});
},
},
};
return { modules };
},
};
</script>
Second, use // pages/index.vue
<template>
<QuillEditorWrapper/>
</template> Reference |
this is useful, but sometimes this tip 'document is not found' may still exist, you can just adjust the component introduction method. |
I am facing: This is my code:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i am adding quill as client plugin and it works good but i cant add this module for it:
QuillEditor.client.ts
main component code:
The text was updated successfully, but these errors were encountered: