Clientlibs issue in AEM 6.5 | Community
Skip to main content
Level 3
September 6, 2019

Clientlibs issue in AEM 6.5

  • September 6, 2019
  • 4 replies
  • 20381 views

Hi Team,

Recently we are migrating to 6.5 before we have all css and js files in etc/clientlibs,

Now adobe recommended to keep in apps

We have Css/js files under /apps/exampleproject/clientlibs/exampleproject/clientlibs_webtrends this path

The description for the above path

  • exampleproject ->projectname
  • clientlibs (nt:floder) -> Folder
  • exampleproject -> cq:Page
  • clientlibs_webtrends -> cq:ClientLibraryFolder added allowProxy =true

I have set the allowProxy=true to clientlibs_webtrends,    but am not able to expose the clientlibs by

/etc.clientlibs/exampleproject/clientlibs/exampleproject/clientlibs_webtrends/js/example.js

I can access the clientlibs using /apps/exampleproject/clientlibs/exampleproject/clientlibs_webtrends/js/example.js

We cant provide access to /apps in production

Please help me in resolving this issue

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Umesh_Sondhi
Level 4
September 6, 2019

hi ,

Please go through this link https://www.initialyze.com/hotfix-for-font/ .

Will help you.

thanks .

Level 3
September 6, 2019

Hi ,

Thanks for the link

I have the same structure as mentioned in the link

Not able to access clientlibs via /etc.clientlibs path as shown in this example

etc.clientlibs/initialyzer/clientlibs/clientlib-base.js

Umesh_Sondhi
Level 4
September 6, 2019

you have to set the allowProxy property on clientlib-base to true....

then you can request /etc.clientlibs/initialyzer/clientlibs/clientlib-base.js

and i hope you are taking care of this point too

Make sure to use a relative path in place of absolute paths.

Umesh_Sondhi
Level 4
September 6, 2019

did you check the minify option in the HTML configuration in the felix console ?

Level 3
September 6, 2019

No, we have removed  it as the pages were not loading

Umesh_Sondhi
Level 4
September 6, 2019

please enable the minify option and then I'd suggest looking at the log file. Sometimes this can happen if there is a syntax error in your JavaScript which is caught by the minimizer.

Adobe Employee
September 6, 2019

Is this issue only observed via dispatcher? If yes, you need to allow etc.clientlibs in the filter rules.

If trying this directly on AEM instance, Setting allowproxy variable should load the clientlib directly on AEM instance using etc.clinetlibs.

Do you see the same issue when using sly? Example:

data-sly-call="${clientlib.js @ categories='clientlib1'}"

Lastly, Can you share the HTML Library Manager configuration from OSGI config manager?

February 22, 2023

It looks ok for config side.

can you try to add using

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"

    data-sly-call="${clientlib.all @ categories='falcon.base.nwd'}"/>

If it works, you can check the included js path and trying adding using script tag.

<script type="text/javascript" src="/etc.clientlibs/initialyzer/clientlibs/initialyzer/clientlib-base/js/example.js"> </script>

You can open a daycare ticket if it doesn't resolve.


I am facing a similar issue accessing js located in /app/../clientlib/ through the proxy servlet.

 

My clientlib config is

name: "clienlib-xyz",
        allowProxy: true,
        categories: ["clienlib-xyz.angular"]
        jsProcessor: ["default:none","min:none"],
        cssProcessor: ["default:none","min:none"],
 
there is a js file: /apps/xyz/clientlibs/clienlib-xyz/js/0.js
 
When I try to access following in publisher, it doesn't load
 
 
 
 
Premkarthic-7WP
Level 4
September 10, 2019

Hi,

As per my understanding, you want to access the js files directly and not via client library include, if I am correct, then you can try creating a folder  with the name "js" under resources  of your required clinetlibray folder and you can access as like below. Its worked for me.

http://localhost:4502/etc.clientlibs/weretail/clientlibs/clientlib-site/resources/js/script.js

Proxy servlet resolves the direct files, if it is present under clientlibray folder (with allowproxy=true) -> resources -> (folder with any name) ->File.

Hope this helps.

Update : In order to avoid the duplicate copy of the file between client library and resource folder, in the js.txt you can change the js base reference as below.