JS Error when loading CKeditor 5 with active Highlight Plugin under Drupal 10.1

Created on 26 July 2023, over 1 year ago
Updated 18 November 2023, 12 months ago

Probably with the Drupal Core Update from 10.0.8 to 10.1.1, the CKEditor is no longer displayed if the Highlight Plugin is activated. This also leads to the CKeditor not being loaded/displayed at all due to the Javascript error.

ckeditor5.js?ryekvm:472 TypeError: Cannot set properties of undefined (setting 'ariaLabel')
    at Object.callback (highlight.js?ryekvm:1:12798)
    at $t.create (ckeditor5-dll.js?v=38.1.0:5:496934)
    at ckeditor5-dll.js?v=38.1.0:5:474313
    at Array.map (<anonymous>)
    at Ie._buildItemsFromConfig (ckeditor5-dll.js?v=38.1.0:5:474221)
    at Ie.fillFromConfig (ckeditor5-dll.js?v=38.1.0:5:474079)
    at n._initToolbar (editor-classic.js?v=38.1.0:4:6492)
    at n.init (editor-classic.js?v=38.1.0:4:6079)
    at editor-classic.js?v=38.1.0:4:9650

Current : Switch back to Drupal Core 10.0.x

🐛 Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

🇩🇪Germany cbeier

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

Merge Requests

Comments & Activities

  • Issue created by @cbeier
  • 🇨🇦Canada mahde Vancouver

    I am getting the same error with Drupal 10.1.5!

  • 🇨🇦Canada mahde Vancouver

    I fixed this by re-building the highlight.js file with the new version of "@ckeditor/ckeditor5-highlight": "~40.0.0" and "@ckeditor/ckeditor5-theme-lark": "~40.0.0", "ckeditor5": "~40.0.0" in the package.json file.

    Hope to get this fixed in this module. Thanks!

  • 🇮🇳India arisen Goa

    I am getting the same error on Drupal 10.1.5. The fixes mentioned in #3 works perfectly fine.
    Verified if the fixes are compatible with Drupal 9.5.11. It isn't working. Throwing error

    TypeError: t.map is not a function
        at ue (ckeditor5-dll.js?v=35.4.0:5:447835)
        at Object.callback (highlight.js?s2rxpt:1:10856)
        at i.create (ckeditor5-dll.js?v=35.4.0:5:416819)
        at ckeditor5-dll.js?v=35.4.0:5:439488
        at Array.map (<anonymous>)
        at X.fillFromConfig (ckeditor5-dll.js?v=35.4.0:5:439398)
        at c._initToolbar (js_tdNyFRf0JHNvXCd9Fmk2k0H7Dmb7NBLR0o8jbyDEUz4.js:4:6337)
        at c.init (js_tdNyFRf0JHNvXCd9Fmk2k0H7Dmb7NBLR0o8jbyDEUz4.js:4:5924)
        at js_tdNyFRf0JHNvXCd9Fmk2k0H7Dmb7NBLR0o8jbyDEUz4.js:4:9072

    Checking if any possible fixes for both Drupal 9 and 10.

  • First commit to issue fork.
  • Merge request !2Updated dependency versions to 39.0.0 → (Merged) created by godotislate
  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7

    I think we should match 10.1 core's ckeditor5 version, which is 39

    And yes, that won't work for <10.1, so this have to go to 1.1.x branch

  • Status changed to Needs review about 1 year ago
  • Changed package.json dependencies to version 39.0.0, and target branch in the MR to 1.1.x. Looks like 1.1.x is behind 1.x right now, so can change target branch back if needed.

    Also, rebuilt the JS, but there's no difference between the 40 build and 39 build.

  • 🇬🇧United Kingdom fonant

    Using plain diff from MR 2 as a patch works to make the button work here :)

  • Status changed to Fixed 12 months ago
  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024