Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Granite clientlibs are included two times

Avatar

Level 1

I'm getting the following error on the page, when I access that in AEM 6.3 touch UI.

foundation.1.0.js:7460 Uncaught TypeError: now.utcOffset is not a function

    at HTMLDocument.<anonymous> (foundation.1.0.js:7460)

    at HTMLDocument.dispatch (jquery.1.0.js:4665)

    at HTMLDocument.elemData.handle (jquery.1.0.js:4333)

    at Object.trigger (jquery.1.0.js:4574)

    at HTMLDocument.<anonymous> (jquery.1.0.js:5284)

    at Function.each (jquery.1.0.js:384)

    at jQuery.fn.init.each (jquery.1.0.js:136)

    at jQuery.fn.init.trigger (jquery.1.0.js:5283)

    at HTMLDocument.<anonymous> (foundation.1.0.js:7505)

    at HTMLDocument.dispatch (jquery.1.0.js:4665)

I checked the source code of the page and found that few of js files are included two times. One is from /libs (/etc.clientlibs/clientlibs) and another is from /etc. I think that the above error must be coming because of any conflict happening due to multiple occurrence of files on the same page. It's occurring on all the pages. Even if I access any Admin page in touch UI like /asset.html/content/dam.

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/jquery.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/jquery.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/utils.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/utils.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/jquery/granite.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/jquery/granite.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/coralui2keys.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/typekit.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/typekit.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/moment.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/moment.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/coralui2.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/uritemplate.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/uritemplate.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/history.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/history.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/granite/ui/components/coral/foundation/clientlibs/foundation.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/jquery/animation.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/jquery/animation.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/granite/ui/clientlibs/quickactions.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/granite/ui/components/endor/clientlibs.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/granite/ui/components/foundation/clientlibs/foundation.1.0.js"></script>

<script type="text/javascript" src="/etc.clientlibs/clientlibs/granite/lodash/modern.1.0.js"></script>

<script type="text/javascript" src="/etc/clientlibs/granite/lodash/modern.1.0.js"></script>

<script type="text/javascript" src="/apps/acs-commons/touchui-widgets/composite-multifield.js"></script>

<script type="text/javascript" src="/apps/acs-commons/authoring/vendor/jquery.fonticonpicker.js"></script>

<script type="text/javascript" src="/apps/acs-commons/touchui-widgets.js"></script>

Is there any way/configuration to avoid to stop multiple occurrences of the these granite clientlibs.  I am working on AEM 6.3.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Thanks Kautuk for you reply.

Actually, the error was coming because of older version of moment.js which was putting in /etc/clientlibs location. This file was overriding the latest version of the same file which was lying in /libs directory.  After removing it from /etc, error has gone.

Thanks,

AS

View solution in original post

3 Replies

Avatar

Administrator

Hi,

I guess you have clientlibs present under both /apps and /etc folder and for /apps you have allowProxy property = true (This makes the clientlibs avail­able via the url /etc.clientlibs/).

So, try to remove the clientlibs from the etc folder and keep it under /apps folder (recommended).

In order to better isolate code from content and configuration, it is recommended to locate client libraries under /apps and expose them via /etc.clientlibs by leveraging the allowProxy property.

Note:- When using proxied client libraries, the AEM Dispatcher configuration may require an update to ensure the URIs with the extension clientlibs are allowed.



Kautuk Sahni

Avatar

Correct answer by
Level 1

Thanks Kautuk for you reply.

Actually, the error was coming because of older version of moment.js which was putting in /etc/clientlibs location. This file was overriding the latest version of the same file which was lying in /libs directory.  After removing it from /etc, error has gone.

Thanks,

AS

Avatar

Level 1

What is the dispatcher config change that we need to do. Allowing /etc.clientlibs/* in .any file?