I use Drupal 9.5.5, CKeditor 5 and BootstrapBarrio theme, but I have also used Claro theme.

I have disabled "Aggregate JavaScript files" and "Aggregate CSS files" option in Performance, Insert Media with Media Library does not load when a user (non admin) edits node.

I get that errors:

Ocurrió un error durante la ejecución de la respuesta Ajax: TypeError: $element.dialog is not a function ajax.js:411:22
    success ...com/core/misc/ajax.js?v=9.5.5:411
    (Asíncrono: promise callback)
    success ...com/core/misc/ajax.js?v=9.5.5:410
    success ...com/core/misc/ajax.js?v=9.5.5:207
    jQuery 6
    execute ...com/core/misc/ajax.js?v=9.5.5:266
    openDialog ...com/core/modules/ckeditor5/js/ckeditor5.js?rrrmc2:280
    init ...com/core/modules/ckeditor5/js/build/drupalMedia.js?rrrmc2:1
    fire ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    click ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    s ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    fire ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    t ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5

Format filter and CKeditor 5 appear when I edit a node, but when I click "Insert media" button, media library does not load.

enter image description here

Any idea?


  • Anonymous users shouldn't have the permission to post images and other media on the site because they can easily break the site or hack it by inserting code along with media. Maybe it's permissions that block showing the button in the editor.
    – prkos
    Mar 19, 2023 at 15:19
  • Error appear in an authenticated user with right permissions, not with anonymous user. But admin user can open dialog to insert media without problem. Mar 19, 2023 at 15:30
  • Did you check permissions for authenticated users for text input formats?
    – prkos
    Mar 22, 2023 at 20:23
  • Body field with CKeditor 5 and filter formar load right. "Insert media" button does not load media library. Permissions are right. Mar 22, 2023 at 21:23

1 Answer 1


I had the same issue with the regular Media Library field. The latest patch here helped me solving that: https://www.drupal.org/project/drupal/issues/3222107 Looks like theres an issue with the set weight of the JS file which results in that error.

Hope, that helps! :)

  • 1
    Thanks!!!! Works for me! Media Library loads when I click in button from Ckeditor5. Mar 31, 2023 at 13:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.