quill-image-resize-module icon indicating copy to clipboard operation
quill-image-resize-module copied to clipboard

vue 3 default" is not exported

Open Olegars opened this issue 2 years ago • 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"; ^

Olegars avatar Jan 02 '23 04:01 Olegars

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.

LDY681 avatar Jan 04 '23 05:01 LDY681

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

Hbin-Zhuang avatar Mar 27 '23 10:03 Hbin-Zhuang

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"

lv23ji avatar Jun 01 '23 07:06 lv23ji

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'],
      },
    }
});

joekrump avatar Oct 04 '23 20:10 joekrump