kensnyder/quill-image-resize-module

vue 3 default" is not exported

Opened this issue · 4 comments

vue 3
yarn build
"default" is not exported by "node_modules/quill-image-resize-module/image-resize.min.js", imported by "src/views/editor.vue".

5: import ImageResize from "quill-image-resize-module";
^

vue 3 yarn build "default" is not exported by "node_modules/quill-image-resize-module/image-resize.min.js", imported by "src/views/editor.vue".

5: import ImageResize from "quill-image-resize-module";
^

import * as ImageResize from "quill-image-resize-module";
I am using Vite with Vue 2. This works for me and should be good with Vue 3 too.

vue 3 yarn build "default" is not exported by "node_modules/quill-image-resize-module/image-resize.min.js", imported by "src/views/editor.vue".

5: import ImageResize from "quill-image-resize-module";
^

import * as ImageResize from "quill-image-resize-module"; I am using Vite with Vue 2. This works for me and should be good with Vue 3 too.

i got the new error of " quill.js:6130 Uncaught (in promise) TypeError: moduleClass is not a constructor" by using this

lv23ji commented

vue 3 yarn build "default" is not exported by "node_modules/quill-image-resize-module/image-resize.min.js", imported by "src/views/editor.vue".

5: import ImageResize from "quill-image-resize-module";
^

import * as ImageResize from "quill-image-resize-module"; I am using Vite with Vue 2. This works for me and should be good with Vue 3 too.

i got the new error of " quill.js:6130 Uncaught (in promise) TypeError: moduleClass is not a constructor" by using this

The correct way to use it is

import "quill-image-resize-module/image-resize.min.js"

The solution that worked for me was:

import ImageResize from 'quill-image-resize-module';

//...

// Note the module is registered as `imageResize` not `ImageResize`
Quill.register('modules/imageResize', ImageResize);
// ...

const quill = new Quill(editorEl, {
    modules: {
       // Note: 'imageResize' (the name needs to match what it was registered as).
       imageResize: {
         modules: ['Resize', 'DisplaySize', 'Toolbar'],
      },
    }
});