Closed DuIIDa closed 1 month ago
Hi! ClassicEditor
should be pulled from ckeditor5
as well. What error did you see then?
Hi! When import directly from ckeditor5 I get the same error. Imports: import { ClassicEditor, Bold, Essentials, Italic, Mention, Paragraph, Undo, Underline, Strikethrough, RemoveFormat, List, BlockQuote, Link, Table, TableToolbar, Heading, } from 'ckeditor5'; import { CKEditor } from '@ckeditor/ckeditor5-react';
Which version of @ckeditor/ckeditor5-react
and ckeditor5
packages do you use? Are you sure that both are installed in the latest available versions?
Second thing to check: You should have no imports from @ckeditor/*
packages expect the react one. In other words, the only imports should happen from @ckeditor/ckeditor5-react
and ckeditor5
.
I tihs version:
I found a solution for myself. But I'm not sure it's correct
Inside the test:
jest.mock('File with CKEditor');
Based on the snippets that you provided, all seems to be correct. I have no idea why you get the dup-modules error. But it's a one that can be triggered by things that are hard to spot.
Would you be able to compile a small sample project where this issue is reproducible?
The issue lacks the feedback we asked for two weeks. Hence, we've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).
I had this problem when running tests(Jest) after migrating from ckeditor4 to ckeditor5.
package.json
"dependencies": { ... "@ckeditor/ckeditor5-react": "^8.0.0", "ckeditor5": "^42.0.0", ... } "jest": { "resetMocks": false, "collectCoverageFrom": [ "*/.{js,jsx,ts,tsx}", "!/integration-tests/", "!/node_modules/", "!/vendor/", "!src/old/", "!src/stories/" ], "watchPathIgnorePatterns": [ "\integration-tests\" ], "transformIgnorePatterns": [ "!node_modules/" ], "moduleNameMapper": { "\.(css|less|scss|sass)$": "identity-obj-proxy" } },
My imports:
import { Bold, Essentials, Italic, Mention, Paragraph, Undo, Underline, Strikethrough, RemoveFormat, List, BlockQuote, Link, Table, TableToolbar, Heading, } from 'ckeditor5'; import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import { CKEditor } from '@ckeditor/ckeditor5-react'; // eslint-disable-next-line import/no-unresolved import 'ckeditor5/ckeditor5.css';
I also tried importing ClassicEditor from ckeditor5.