0

I am trying to integrate a custom CKEditor 5 plugin (LanguageTool) into Drupal 10 using a custom module. The plugin builds successfully, but when Drupal loads the editor, the browser console shows:

CKEditorError: plugincollection-plugin-not-found {"plugin": null}

The editor loads, but the custom plugin does not initialize.


🟩 What I Have Done (Summary)

  • Created a CKEditor 5 custom build with the plugin included.

  • Ran npm install and npm run build.

  • Copied the generated build/ckeditor.js into my Drupal custom module.

  • Created a Drupal CKEditor5 plugin class:

/**
 * @CKEditor5Plugin(
 *   id = "ckeditor5_languagetool_plugin",
 *   label = @Translation("LanguageTool")
 * )
 */
class LanguageTool extends CKEditor5PluginBase {
  public function getPlugins() {
    return [ 'LanguageTool' ]; // JS pluginName
  }
}
  • Added library in my_module.libraries.yml

  • Enabled plugin in text format

  • Cleared caches (drush cr)


🟥 Current Problem

The error indicates that Drupal is requesting a CKEditor plugin with name "null", which usually means:

  • Plugin ID mismatch

  • Plugin name in text format config does not match PHP annotation

  • JS pluginName does not match getPlugins() return value

But after checking, I still see the error.


🟦 Code / Config Samples

PHP plugin class

/**
 * @CKEditor5Plugin(
 *   id = "ckeditor5_languagetool_plugin"
 * )
 */
class LanguageTool extends CKEditor5PluginBase {
  public function getPlugins() {
    return [ 'LanguageTool' ];
  }
}

JS plugin

export default class LanguageTool extends Plugin {
  static get pluginName() {
    return 'LanguageTool';
  }
}

Text format config

ckeditor5.plugin.ckeditor5_languagetool_plugin:
  enabled: true

🟧 What I Want to Know

  1. Should the Drupal plugin ID (ckeditor5_languagetool_plugin) match directly with the JS pluginName or only with the text format entry?

  2. Are there any known issues about custom plugin loading with Drupal CKEditor 5 integration?

  3. Is there a debugging method to see which plugin name Drupal is sending to CKEditor?

  4. Am I missing any step in mapping the Drupal plugin to CKEditor’s pluginName?


🟩 Environment

  • Drupal 10.x

  • CKEditor 5 custom build

  • Custom Drupal module

  • PHP 8.1

  • Browser: Chrome

New contributor
Jency is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.