ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Error "ckeditor-duplicated-modules" - What Are the Alternatives to Importing from src?

Open NikoEscobar opened this issue 1 year ago • 1 comments

📝 Ask a Question

Description

I recently upgraded my React project to use the latest version of CKEditor, migrating from version 40.1 to 43.2. Along with this, I switched from Webpack to Vite and adopted the new CKEditor installation methods. However, I am facing issues with custom plugins in my project.

These plugins use classes and function helpers from the CKEditor table source. After the migration, I now encounter the following error:
ckeditor-duplicated-modules

I read in the documentation that we can import specific files from the dist directory, but I haven't been able to locate the following imports in the dist path:

import TableWalker from '@ckeditor/ckeditor5-table/src/tablewalker';
import {
  sumArray,
  getColumnEdgesIndexes,
  getElementWidthInPixels,
  getTableWidthInPixels,
  toPrecision,
  getDomCellOuterWidth,
  clamp,
  getColumnGroupElement,
  getTableColumnsWidths
} from '@ckeditor/ckeditor5-table/src/tablecolumnresize/utils';

My Question

Given how my custom plugin is structured, am I unable to migrate to the new installation methods? Or are there alternatives I can pursue to resolve the issue?

Any guidance or suggestions would be appreciated.

NikoEscobar avatar Oct 08 '24 17:10 NikoEscobar

Sorry for keeping you waiting. This is a topic we are discussing internally, and we will publish some detailed messaging soon. Long story short, our Typescript release introduced import indexes (v37), and v42 release introduced tighter APIs as the editor is prebuilt in a bundler. As everything was available historically in src, we are quite surprised sometimes what was used by integrators. We need to figure out what to export and what keep internal to not have too many breaking changes in the future.

We will try to add exports you need in the next release and I will keep you posted if we included everything. Meanwhile, code copy would be the only sufficient method, unfortunately.

Witoso avatar Oct 14 '24 13:10 Witoso

Hello, I'm facing a similar issue. in migrating to v44 from v40 alot of the util classes from the ckEditor libraries such as lists and tables are not available which is breaking huge chunks of the codebase at the moment.

is there any updates on this?

really appreciate all the work you and your team have been doing.

mosaabramadan avatar Mar 04 '25 20:03 mosaabramadan

Please read the #17289, we would need an issue with what you are missing to add. We already added multiple things in the pas months, if someone is still missing something, please add new issues. Thanks!

Witoso avatar Mar 05 '25 08:03 Witoso