Unable to load with JS aggregation enabled

Created on 16 December 2024, 4 months ago

Problem/Motivation

With Drupal JS aggregation enabled, the plug-in doesn't load.
We are using find-and-replace, not sure if this is the same for other plugins

It seems maybe related to load ordering.
The find-and-replace JS script from CDN is loaded before the CKEditor 5 panel.

With JS aggregation disabled, the find-and-replace JS script will be loaded separately after the CK5 aggregated JS. Then the plugin is working.

Steps to reproduce

Navigate to Admin, Performance
Enable JS aggregation
Enable find-and-replace in one of the Text Format
Create an article using one of the Text Format, the CK5 panel cannot be loaded. No JS error in console.

Proposed resolution

For remote script, setting the weight seems not working because it cannot set a positive number via hook_library_info_build.
For local script, setting the dependency 'core/ckeditor5.basic' to make it work.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇨🇦Canada francismak

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

Merge Requests

Comments & Activities

  • Issue created by @francismak
  • Hi francismak

    Thank you for reporting the issue - we'll try to address it in one of upcoming releases.

  • 🇵🇱Poland salmonek

    Hi francismak

    Unfortunately I wasn't able to reproduce the issue so far.
    Do you have core aggregation only or with some extension module (AdvAgg)?
    Can you share list of toolbar plugins enabled in your text format

  • 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺

    I think I got the same issue. But I got the issue in Layout builder when adding a new basic block. The patch doesn't seem to fix it for me.

  • 🇵🇱Poland salmonek

    Hi phjou

    Is your case also without any errors in JS console?
    Does it stop occuring without aggregaton?

    The patch will be for sure applied to the 1.3.x branch as code setting dependency on 'ckeditor5/ckeditor5 has been copied form Premium Features module and it is an oversight that we didn't update it after CKEditor 5 was moved to core and now it doesn't make sense.

  • 🇵🇱Poland salmonek

    @francismak

    I've created a MR with slightly updated your patch - added license info and changed library ckeditor5.basic to just

    ckeditor5

    Removing 'preprocess' => FALSE seems to have no effect - libraries dowloaded form external source are still in their respective files, but I've also added that change for case when libraries are loaded locally.

    We would appreciate a feedback if that still fixes your issue.

  • 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺

    After some research, it seems that it is "CKEditor 5 Word Count" that is responsible for this error in my case. Uninstalling that module makes Ckeditor load again and the rest of the plugin I use "WProofreader" and "Paste Filter" are working fine.

    This doesn't happen all the time for me. It seems to happen when adding a new block to a page using layout builder and I do have the layout_builder_iframe_modal module as well. When editing a block, it works well, it is only when adding a new one that the problem occurs.

    The patch doesn't fix that loading issue for me.

  • 🇨🇦Canada francismak

    salmonek, thank you for the updates. I just tried it out, and it is working properly.

  • 🇵🇱Poland salmonek

    @francismak
    No worries, despite I wasn't able to reproduce, the previous code didn't make sense, so the update is going to be released. Thank you for review.

    @phjou
    Since it looks like your issue is not related to the one francismak reported, please move conversation here 🐛 Editor doesn't load with Word Count enabled and in scope of Layout Builder Active
    I added few questions there. Hopefully they will help with reproduction.

    • salmonek committed f44dbd8d on 1.3.x
      Issue #3494274 by francismak: Unable to load with JS aggregation enabled
      
  • 🇵🇱Poland salmonek

    Fix has been released in version 1.3.1

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024