How to use 2 different ckEditor5 in one build

332 Views Asked by At

I am following this link(documentation) but it is not working.

https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/advanced-setup.html#creating-super-builds

When I create a build using 2 different ckEditros(ckEditor5) it give me following error.

ERROR Error: Uncaught (in promise): TypeError: this.editor.create is not a function TypeError: this.editor.create is not a function at CKEditorComponent.

enter image description here

please guide me about that problem if anyone knows about it.

2

There are 2 best solutions below

0
On

use different

id

for each CKEditor.

if the issue still persists then try sharing some code so i can see what's happening

0
On

Yes, you can do that. You can install two versions of same npm modules. First of all, delete the existing version and install using this command and you can provide the version number to install it. This is the command:

npm i <package_name_alias>@npm:<package_name>

In your case, it should become this(for latest version):

npm i latest-ckEditor5@npm:ckEditor5

And for any other version lower than the latest use this:

npm i latest-ckEditor5@npm:ckEditor5@versionNumber

In your package, it will look something like this:

  "dependencies": {
    "latest-ckEditor5": "^latestPackage",
    "oldest-ckEditor5": "Olderverion"
  }

You can use them like this:

import { ckEditor5 } from 'latest-ckEditor5'; // check the exported member name
import { ckEditor5 } from 'oldest-ckEditor5';