Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Restrict loading of clientlibs-jquery

Avatar

Level 5

Hello All - Following clientlibs are getting loaded in publish eventhough it is not added as part of our project specific clientlibs. Becasue of these clientlibs loading, it is causing issues with project specific clientlibs. is there a way to restrict these clientlibs in publish.

 

/etc.clientlibs/clientlibs/granite/jquery.min.js
/etc.clientlibs/clientlibs/granite/jquery/granite.min.js
/etc.clientlibs/foundation/clientlibs/jquery.min.js

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@v1101, This looks like an unwanted client library of "cq.jquery" is being called within your page. 

How to solve: You need to look at your project files, structure basepage, components, and/or project client library configurations to find a reference of the "cq.jquery" name. If your codebase does not have such values in your project, then you should take a look at the resourceSuperType cq:component scripts and/or client libraries being referenced within the different resources within CRX/DE. Understand what, where, and who is actually including the "cq.jquery" client library would be the first step of removing this unwanted set of libraries.

Once you have found the underlying cause, your next step is to overwrite the resource's script file that includes "cq.jquery", by overlaying (if it is a script file) or to simply edit the client library that is referencing the "cq.jquery" client library name.

I hope this helps.

 

 

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @v1101 

 

Could you please validate if any of your project client-lib has dependency property pointing to AEM jquery clientlibs like cq.jquery or cq.jquery.ui which might call these clientlibs in publish?

For debugging in LOCAL, You can just remove your project specific clientlib category from code and validate it if it is still appearing. If not appearing then probably your project specific clientlib is calling them in publish.

 

Regards,

Arpit Varshney

Avatar

Community Advisor

Hi,

 

Just to add to the above answer check whether you have included 

 

<cq:includeClientLib js="cq.jquery"/> in your project jsp or added cq.jquery category as embed or dependency to any of your project clientlibs

Avatar

Level 5
Hi Ravi - I dont find any dependency or embed to this jquery. Do you think it is pulling these librabries based on the resourceType or resoureSourceType used for the components?.

Avatar

Community Advisor
Hi Vignesh, There might be a scenario where these files might be included from OOB file inclusions or category inclusion. Are you seeing these files on view source ? If so see after what code it is getting included so that we can find from which these are included.

Avatar

Correct answer by
Community Advisor

@v1101, This looks like an unwanted client library of "cq.jquery" is being called within your page. 

How to solve: You need to look at your project files, structure basepage, components, and/or project client library configurations to find a reference of the "cq.jquery" name. If your codebase does not have such values in your project, then you should take a look at the resourceSuperType cq:component scripts and/or client libraries being referenced within the different resources within CRX/DE. Understand what, where, and who is actually including the "cq.jquery" client library would be the first step of removing this unwanted set of libraries.

Once you have found the underlying cause, your next step is to overwrite the resource's script file that includes "cq.jquery", by overlaying (if it is a script file) or to simply edit the client library that is referencing the "cq.jquery" client library name.

I hope this helps.