Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Page builder
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Sep 2024 at 07:08 UTC
Updated:
8 Oct 2024 at 20:59 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
akhil babuComment #3
wim leersThanks, @akhil babu! 😄
Comment #4
akhil babuCouldn't figure out why the widget is not working with js aggregation enabled :( Maybe something to do with the order in which the js is executed?
Comment #5
johnwebdev commentedSo I think I understand why this is happening, but I'm not yet sure how to solve it:
In experience_builder/ui/src/services/processResponseAssets.ts we have:
The following line:
makes sure we don't add a JavaScript file that's already been added. The problem is that when we have aggregation enabled the file name is random and will contain multiple libraries/files.
So what's happening here is that multiple JS files already loaded will be loaded incorrectly again, and e.g core/misc/ajax.js gets loaded twice, and I can see that it doesn't get the commands registered correctly (openDialog, closeDialog) from e.g dialog.ajax.
Comment #10
omkar-pd commentedComment #11
omkar-pd commentedIf aggregation is on in console I see
upon logging Drupal we get- the ajax,AjaxCommands is not getting attached.

Comment #12
omkar-pd commentedTurns out ajax, AjaxCommands are not getting attached because of this error
this error comes from
core/themes/olivero/js/navigation-utils.js. I solved this error manually and media library widget works with aggregation on.Moving this to needs review just to check If others getting same error in console.
Comment #13
omkar-pd commentedComment #14
atul_ghate commentedI am also encountering the same issue when JavaScript aggregation is enabled.

Comment #15
akhil babuHi @atul_ghate, Did you test with the latest changes?
I tested MR 277 and the media library widget works fine with JS aggregation enabled

Pushed one more commit to the MR to remove the warning
Comment #16
omkar-pd commented@akhil babu,
Check the screenshot in IS, the media library widget should look like it.
Please test again with a fresh install.
1. Install Drupal
2. Enable Media, Media Library, XB, Xb Vite Integration modules,
3. Add article and go xb/node/1
4. Click on the image component & check the console for errors.
5. If you click on Add Media it does not work.
Comment #17
omkar-pd commentedComment #18
omkar-pd commentedComment #19
omkar-pd commentedUnassigning myself. I will check this once thisissue is fixed.
https://www.drupal.org/project/experience_builder/issues/3472900#comment...
Comment #20
wim leersI was going to say this too, I'm ~90% confident that #3472900: XBEndpointRenderer & processResponseAssets() do not support `ajaxPageState` ⇒ duplicate CSS/JS loading will fix this. See my detailed analysis at #3472900-13: XBEndpointRenderer & processResponseAssets() do not support `ajaxPageState` ⇒ duplicate CSS/JS loading for why.
(I haven't read this issue in detail, otherwise it'd probably be 99%.)
Comment #21
wim leers#3472900: XBEndpointRenderer & processResponseAssets() do not support `ajaxPageState` ⇒ duplicate CSS/JS loading is in. Let's verify that this no longer can be reproduced 🙏
Comment #22
wim leersComment #23
wim leersComment #24
bnjmnmI believe #3472900: XBEndpointRenderer & processResponseAssets() do not support `ajaxPageState` ⇒ duplicate CSS/JS loading fully addresses this and has the e2e test as proof, but we should at least use this issue to remove the LOC in
experience_builder_field_widget_complete_form_alterthat are there only to report that the widget does not work with aggregationComment #25
wim leers#24 — whew, great call! 😅
Comment #26
wim leersComment #27
kristen polFixing tag
Comment #29
bnjmnm