Friday 7 May 2021

AEM Clientlibs debugging

 One of the embedded clientlibs is not loading:

  •  Use the following procedure to see the names of all the embedded files:

                In the address box of your web browser, append the following text to the URL of your                             HTML:      ?debugClientLibs=true

  • When the page loads, view the page source.
  • Click the link that is provided as the href for the link element to open the file and view the source code.

 Few clientlibs are not getting minified:

  • Check if minify option is enabled at AEM HTML Library Manager.
  • If this is still an issue, set up a debug logger to check for any syntax errors. Please follow the steps below :

            Go to http://<host>:<port>/system/console/slinglog

            Click on "add new logger"

            Set the Log Level to DEBUG

            Change the log Filename to "clientlibs.log"

            Add the following class in the "Logger" field:

            com.adobe.granite.ui.clientlibs

            Click on Save.

  • If you see errors similar to below, this means there are some syntax errors in the clientlibs file. 

 27.06.2019 11:36:01.450 *ERROR* [0:0:0:0:0:0:0:1 [1561649761160] POST /libs/granite/ui/content/dumplibs.rebuild.html HTTP/1.1] com.adobe.granite.ui.clientlibs.processor.gcc.impl.YUIScriptProcessor Processed /apps/acs-commons/components/dam/custom-component-activator/clientlib/activator.js. 1 error(s), 0 warning(s)

27.06.2019 11:36:01.450 *DEBUG* [0:0:0:0:0:0:0:1 [1561649761160] POST /libs/granite/ui/content/dumplibs.rebuild.html HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.HtmlLibraryBuilderImpl processing /apps/acs-commons/components/dam/custom-component-activator/clientlib with processor yui for mode min rejected.

You can also try changing the Script processor from YUI to GCC as there might be some newer js files which can be only processed by newer processor.

...

- Go to <host>:<port>/libs/granite/ui/content/dumplibs.rebuild.html

- Click on invalidate cache

- Now try to load the page where you are loading the custom clientlib and AEM should try to minify it.

- You should see details about why minification is failing in the DEBUG logger setup in the first step.

No comments:

Post a Comment