ckeditor / ckeditor5-vue

Official CKEditor 5 Vue.js component.
https://ckeditor.com/ckeditor-5
Other
358 stars 77 forks source link

Custom build issues (object, instead of function) - Documentation issues? #252

Open yvesh opened 1 year ago

yvesh commented 1 year ago

Hello,

using Vue 3, Vite, TS and an custom ckeditor 5 build (nothing fancy, just some plugins, no watchdog) following the documentation got me an "Error: this.editor.create is not a function".

import Editor from 'ckeditor5-custom-build/build/ckeditor';

returns an Object and not a function:

{Editor: ƒ, EditorWatchdog: ƒ}

Workaround:

<CKEditor.component :editor="Editor.Editor"
 />

or just import it correctly:

import { Editor } from 'ckeditor5-custom-build/build/ckeditor'; // Stated different in the docs

Or did I miss something?

Thanks!

Witoso commented 1 year ago

Thanks for reaching out @yvesh. Very strange indeed. Are you sure watchdog was not added as a dependency of some plugin? Check the src/ckeditor.js or package.json in the Online Builder folder.

I only replicated this situation when I added the watchdog plugin. Export in src/ckeditor.js looks like this then:

export default { Editor, EditorWatchdog };