- Issue created by @gabykule
- 🇦🇷Argentina gabykule
Same problem happens with other components, I guess is something related to Drupal 10.1 instead of Gutenberg project.
https://www.drupal.org/project/acquia_cms_site_studio/issues/3371531 🐛 Layout canvas doesn't load with JS aggregation enabled in Drupal Core 10.1.0 Active - 🇵🇱Poland Patryk Padus
@gabykule
Solution is to update core drupal as patch fix weight of dependencies in aggregation engine
https://www.drupal.org/project/gutenberg/issues/3348997 🐛 Gutenberg does not load with css and js aggregation enabled Closed: works as designed
Pleas verify if that help in this scenario as well - 🇮🇳India rajeshreeputra Pune
This is happening because Drupal 10.1 trying to aggregate the minified/aggregated js files from modules/projects.
- 🇷🇴Romania stefan.butura
This seems to only occur with JS aggregation on. Here is quick workaround to disable JS aggregation only for Gutenberg libraries until there is an official solution.
/** * Implements hook_library_info_alter(). */ function MODULENAME_library_info_alter(&$libraries, $extension) { if ($extension === 'gutenberg') { foreach ($libraries as $name => &$library) { if (empty($library['js'])) { continue; } foreach ($library['js'] as $file => &$properties) { $properties['minified'] = TRUE; $properties['preprocess'] = FALSE; } } } }
- 🇳🇱Netherlands yustinTR
The solution stefan.butura suggested worked fine for our project
- 🇮🇳India rushiraval
This is issue related to Drupal Core issue/bug in JS aggregation. May be resolved in next update. Till that it can be used without any code or patch by disabling Aggregate JavaScript files.
Step: Administration-> Configuration ->Development -> Performance and disable Aggregate JavaScript files.
- Status changed to Needs review
over 1 year ago 12:48pm 28 July 2023 - Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - 🇩🇪Germany szeidler Berlin
It indeed seems to be related to the Drupal core issue in 🐛 JsOptimizer preg_replace gives null as return Needs work .
Since it's not recommendable to disable JS aggregation for the whole site the workaround in #6 just seem to be perfect. Here's a patch for it.
Since Drupal core issue has not gotten much attention, we might need to add this workaround to the module. Since it only affects the backend, it sounds absolutely alright to just disable aggregation for them.
Thanks for your contributions.
- Status changed to RTBC
about 1 year ago 3:48am 8 September 2023 - 🇳🇿New Zealand Gold 20 minutes in the future
The patch at #10 is looking good. I'm running with it in 2 environments at the moment and both apply fine.
+1 for RTBC.
Just tried the patch that disables JS aggregation for Gutenberg libraries, and I confirm it worked for resolving JS Errors when using Gutenberg in Drupal 10.
+1 for RTBC as well.
-
szeidler →
committed 1d1fe5ff on 8.x-2.x
Issue #3372307 by szeidler, gabykule, stefan.butura: Javascript Errors...
-
szeidler →
committed 1d1fe5ff on 8.x-2.x
- Status changed to Fixed
about 1 year ago 9:14am 12 September 2023 - 🇩🇪Germany szeidler Berlin
Thank you for your contributions. This has been committed to dev.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
about 1 year ago 8:44am 14 October 2023 Thanks for the fix!
How about a release for this one? Isn't it critical if the editor does not load at all?
- 🇩🇪Germany szeidler Berlin
We have been hoping for bigger attention on the underlying core issue, but it ended up in a new Gutenberg release 8.x-2.8 now :)