Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Granite clientlibs are included two times

Ashwani_Sahni
Level 1
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
Ashwani_Sahni
Correct answer by
Level 1
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
kautuk_sahni
Community Manager
Community Manager

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.

Ashwani_Sahni
Correct answer by
Level 1
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

venkatgantakkd
Level 1
Level 1

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