Problem/Motivation
Javascript errors
Uncaught SyntaxError: Identifier 'r' has already been declared
index.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'Fragment')
Uncaught TypeError: $(...).find(...).drupalSetSummary is not a function
Appears in a working enviroment for Drupal 10.0 that was upgraded to Drupal 10.1
Same problem happens with other components, Maybe is something related to Drupal 10.1 instead of Gutenberg project.
https://www.drupal.org/project/acquia_cms_site_studio/issues/3371531
Steps to reproduce
Install Drupal 10.0 with Gutenberg 2.7. working environment
Upgrade to Drupal 10.1, Blank page appears in gutenberg content
Upgrade component to 2.7 dev, same errors.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
gabykule commentedSame 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
Comment #3
gabykule commentedComment #4
patryk padus commented@gabykule
One of solution is to update core drupal as patch fix weight of dependencies in aggregation engine
There is 10.1 update too.
I combine too #2990907 issue if this can help.
Pleas check if this two patch fix issue
Comment #5
rajeshreeputraThis is happening because Drupal 10.1 trying to aggregate the minified/aggregated js files from modules/projects.
Comment #6
stefan.butura commentedThis 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.
Comment #7
ken hawkins commentedComment #8
yustintr commentedThe solution stefan.butura suggested worked fine for our project
Comment #9
rushikesh raval commentedThis 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.
Comment #10
szeidler commentedIt indeed seems to be related to the Drupal core issue in #2990907: JsOptimizer preg_replace gives null as return.
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.
Comment #11
goldThe patch at #10 is looking good. I'm running with it in 2 environments at the moment and both apply fine.
+1 for RTBC.
Comment #12
leomontenegro6 commentedJust 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.
Comment #14
szeidler commentedThank you for your contributions. This has been committed to dev.
Comment #16
leksat commentedThanks for the fix!
How about a release for this one? Isn't it critical if the editor does not load at all?
Comment #17
szeidler commentedWe 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 :)