Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ckeditor-duplicated-modules error #4

Open
alokjain-lucky opened this issue Aug 28, 2024 · 2 comments
Open

ckeditor-duplicated-modules error #4

alokjain-lucky opened this issue Aug 28, 2024 · 2 comments

Comments

@alokjain-lucky
Copy link

"dependencies": {
        "@ckeditor/ckeditor5-build-classic": "^36.0.1",
        "@ckeditor/ckeditor5-react": "^5.0.2",
}

React Component for Editor

import { CKEditor } from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";

import ResizableHeight from "@pikulinpw/ckeditor5-resizableheight";

// override the default styles
import "./custom.css";

const Editor = ({ data, setData, config = {}, height = "200px" }) => {
    return (
        <CKEditor
            editor={ClassicEditor}
            config={{
                toolbar: {
                    shouldNotGroupWhenFull: true,
                },
                plugins: [ResizableHeight],
                ...config,
            }}
            data={data}
            onChange={(event, editor) => {
                const data = editor.getData();
                setData(data);
            }}
            onReady={(editor) => {
                editor.editing.view.change((writer) => {
                    writer.setStyle(
                        "height",
                        height,
                        editor.editing.view.document.getRoot(),
                    );
                });
            }}
        />
    );
};

export default Editor;

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

Please suggest how do I fix this error?

@abejordan
Copy link

The issue seems to be because of the imported 'Plugin' class in the ResizableHeight.js file
It is currently this:
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
It should be this:
import { Plugin } from 'ckeditor5';

Reference here: https://ckeditor.com/docs/ckeditor5/latest/framework/tutorials/creating-simple-plugin-timestamp.html#creating-a-plugin

@bharathkristam
Copy link

Hi Thanks for the plugin ... even i am facing the same error...
I tried replacing the content in #ResizableHeight.js but no luck
Should we run yarn install / npm install in the custom build ? please suggest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@alokjain-lucky @bharathkristam @abejordan and others