Problem/Motivation

When updating to 10.3.0-beta1 and having aggregation turned on noticed that all ckeditor5 fields are broken, and breaking all functionality on the page like Media library and admin toolbar

error

Even though doesn't point out Ckeditor Media Resize specifically when I turn this filter off everything goes back to working

Steps to reproduce

Install 10.3.0-beta1
Enabled css/js aggregation
Setup a text editor using the filter
See ckeditor5 fields are broken

Proposed resolution

TBD

Remaining tasks

Fully determine cause
Determine fix
Implement

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

smustgrave created an issue. See original summary.

smustgrave’s picture

ericgsmith’s picture

I see this too on a site on 10.3.1 with several contrib ckeditor plugins.

Disabling various combinations of plugins seems to break ckeditor when aggregation is one. One of which is this module.

Can't see any errors in console when aggregated or not.

Have tried with the patch in #3458385: Drupal core 10.3 breaks compatibility with CKEditor5 API but still see the same issue.

ericgsmith’s picture

Status: Active » Needs review

Ok - this was very difficult to reproduce outside of the site I had in question.

I was not able to reproduce it on a clean install with just ckeditor_media_resize enabled / configured with aggregation enabled.

I then started one by one trying to replicate additional things that were on the site in question - various config options and module enabled seemed to trigger this - but the one consistency was this module being enabled.

I could observe that the aggregate JS was loading and the plugin JS was loading outside the aggregate. Several modules I had in use appeared to use this pattern.

After removing preprocess: false from the libraries definition I have not been able to reproduce the error.

I'm suspect something around the aggregation and plugin loading is flaky? And so this is why it was difficult to reproduce - throwing more and more plugins / JS into the mix seems to bring the error to the surface.

I assume the aggregation problem may not be specific to this module - but I'm not overly familiar with the plugin so perhaps there is something module specific at play here. Either way - I can't see any specific reason why the plugin should be excluded from the aggregate - a quick google showed that core plugins removed preprocess: false in 9.3 - in #3264512: Enable aggregation for CKEditor 5 assets

Perhaps somebody more familiar with the ins and outs of CKEditor plugins will know more - but that change seems to fix the issue for me.

@smustgrave - I am curious if you are still able to reproduce this issue with your setup?

jacobupal’s picture

I had a very similar situation, but it was removing the Media Embed icon from the toolbar which fixed the situation rather than the Media Resize filter (which didn't solve it) so the problem may be somewhere in the core Media module.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Actually believe this can be closed a duplicate of #3458385: Drupal core 10.3 breaks compatibility with CKEditor5 API. Once applying the fix from over there everything works as expected. Only RTBC so it puts it in front of hte maintainers to move over credit.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #3463309: Plan for CKEditor Media Resize 1.0.0-beta2

Thanks for working through this.

visios’s picture

Status: Fixed » Active
StatusFileSize
new417.15 KB

I am still experiencing this error on my install with Drupal 10.3.2 and ckeditor_media_resize 1.0.0-beta2 or 1.0.x-dev.

Screenshot Error

Can anybody confirm that the error is really fixed or also still having this issue?

ericgsmith’s picture

+1 that its still an issue.

I mentioned in #3 that I was testing with the patch from the now committed #3458385 in place - I don't think this is a duplicate issue.

@visios I can see you also have JS aggregation enabled - does it work for you with aggregation disabled? And if so, would you be able to test MR11 (with aggregration enabled)?

I was never able to find the root issue but for me allow the plugin JS to be aggregated made the issue go away completely.

I don't see a reason why the module should not allow the plugin JS should be not be aggregated.

visios’s picture

Yes, the module works fine with JS aggregation disabled. I tried the MR you mentioned but unfortunately the problem persists.

ericgsmith’s picture

Ah thanks for testing, that is a shame - I suspect I will hit this error again at some point.

Do you have any other ckeditor plugins forcing a break in aggregation?

If you are happy to share other ckeditor contrib you have in use I can compare it to my setup where I was able to reproduce the issue.

davedg629’s picture

I'm having the same issue when aggregation is enabled.

I have two other CKEditor modules enabled: CKEditor IndentBlock and CKEditor5 Fullscreen.

I uninstalled CKEditor5 Fullscreen and the issue was resolved.

I then re-installed CKEditor5 Fullscreen and uninstalled CKEditor IndentBlock and the issue was NOT resolved.

ericgsmith’s picture

Status: Active » Closed (duplicate)

#3471500: CKEditorError: plugincollection-plugin-not-found eventually did the same fix as MR11 - I had missed that this was reopened as active rather than needs review - happy the fix got in eventually :)

ericgsmith’s picture