ckeditor/ckeditor5-react

Erro ckeditor-duplicated-modules no react

daviAlves16 opened this issue · 2 comments

I'm trying to install a plugin in ckeditor, but it's always giving me this error:

ckeditor-duplicated-modules
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-ckeditor-duplicated-modules

This is the component:

import "./styles.css";
import` React, { useEffect, useRef, useState } from "react";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import GeneralHtmlSupport from "@ckeditor/ckeditor5-html-support/src/generalhtmlsupport"

export default function CkEditorTest() {
  const initialHtml = "";
  return (
    <div style={{ height: "30rem", width: "100%" }}>
      <CKEditor
        editor={ClassicEditor}
        data={initialHtml}
        config={{
          plugins: [GeneralHtmlSupport],
        }}
        onChange={(event, editor) => {
          const data = editor.getData();
          //handleEditorChange(event, editor);
        }}
      />
    </div>
  );
}

`

and as dependencies package.json:

"dependencies": {
    "loader-utils": "3.2.1",
    "@ckeditor/ckeditor5-build-classic": "^40.1.0",
    "@ckeditor/ckeditor5-html-support": "^40.1.0",
    "@ckeditor/ckeditor5-react": "^6.2.0",
    "mapbox-gl": "2.15.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-map-gl": "7.1.6",
    "react-scripts": "5.0.1"
  }

code link in sandbox: https://codesandbox.io/p/sandbox/stupefied-galois-pj58t3?file=%2Fpackage.json%3A7%2C3-17%2C4

with the same erro on adding the selector placeholder plugin

Please note that you are trying to add a plugin to a predefined editor build, which is not possible. The error message docs you linked explain in details why this happens.

In case you want to have a customized set of plugins, you will need to create a custom editor. When integrating with React, please follow the guide on customized installation (we recommend especially the Online Builder approach).

Closing the issue as this does not concern the React integration specifically.