Resolving ckeditor-duplicated-modules errors

Created on 18 January 2023, almost 2 years ago
Updated 17 November 2023, about 1 year ago

Problem/Motivation

I've built the sample plugins as described in CKE docs (https://ckeditor.com/docs/ckeditor5/latest/framework/guides/plugins/crea...) in the CKE environment (ie outside Drupal) and they all work. I've also adapted a couple of other plugins to work there.

I'm trying to add the example Abbreviation plugin to Drupal by adapting the ckeditor5_dev template.
https://ckeditor.com/docs/ckeditor5/latest/framework/guides/plugins/abbr...
I can get through part 1 OK but as soon as I try to add import ContextualBalloon from '@ckeditor/ckeditor5-ui'; , I build Ok then get the dreaded duplicate modules error in the browser console on reloading edit page:

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

Trying to convert the Plugin and ButtonView to use full src path gives same error (even without ContextualBalloon). The uncommented lines below work to get plugin to the current point and the commented-out have been tried in attempt to get ContextualBalloon in.

import { Plugin } from 'ckeditor5/src/core';
//import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import { ButtonView } from 'ckeditor5/src/ui';
//import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
//import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon';
//import { ContextualBalloon, clickOutsideHandler } from '@ckeditor/ckeditor5-ui';

Any thoughts on how to resolve this?

Steps to reproduce

Proposed resolution

Remaining tasks

Add comments to project notes

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Jons

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024