Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
453 stars 600 forks source link

Composite multifield: Underscore dependency missing #3333

Closed roszpapad closed 5 months ago

roszpapad commented 6 months ago

AEM version: 6.5.20 ACS AEM Commons Version: 6.3.2 Reproducible on Latest? yes

Expected Behavior

There is no JS error in the console.

Actual Behavior

Current error in the console:

image

The issue is caused by window._ is undefined. /apps/acs-commons/touchui-widgets/composite-multifield and more touch-ui widgets depend on lodash.underscore which is not found in AEM 6.5.20. Therefore, we always get this issue. A potential fix would be to depend on acs-commons.lodash instead (/apps/acs-commons/clientlibs/vendor/lodash) or depend on cq.integ.underscore (/libs/cq/personalization/clientlib/underscore)

Steps to Reproduce

Embed acs-commons.authoring.composite-multifield clientlib. If you open a dialog, the JS issue will appear.

Note: /apps/acs-commons/touchui-widgets/search-based-path-browser also depends on lodash.underscore.

roszpapad commented 6 months ago

FYI The same issue was fixed in https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/2821 by introducing lodash.underscore. But this category is not working anymore.

roszpapad commented 6 months ago

I am closing this issue because in the end, it seems that some of our customizations broke this functionality. I will reopen this if it is not the case.

roszpapad commented 6 months ago

I am reopening the issue. I double-checked it and the issue is with the dependency of composite-multifield. On my local environment, I changed it manually to acs-commons.lodash and the issue was gone. Can you please double-check it on your side as well?

kwin commented 6 months ago

FTR: According to https://experienceleague.adobe.com/en/docs/experience-manager-65/content/release-notes/deprecated-removed-features

Deprecated Feature: Lodash/underscore client library. Adobe does not plan to further maintain and update the Lodash/underscore client library that is shipped as part of the distribution (Quickstart).

Replacement: Adobe recommends customers that still require Lodash/underscore for their code to add it into their project code base.