Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

ClientLib minification issue

Avatar

Level 3

Hello Community - I see some issues with the clientLib minification in the JS. This is happening only for few of the clientLibs and for other clientLibs in the same project is working fine without any issues.

After enabling the debug logs, I found that there are some issues with minification for the spcecific clientlib failed with the error "with processor gcc for mode min rejected". Even though it failed with some errors for the minification, I am able to minify the JS using online utility(https://closure-compiler.appspot.com/home, https://javascript-minifier.com/) without any errors.

 

Error:

com.adobe.granite.ui.clientlibs.processor.gcc.impl.GCCScriptProcessor Processed /etc/designs/testapps/testClientlibs.js. 5 error(s), 0 warning(s)
13.08.2021 13:55:19.616 *DEBUG* [10.129.38.226 [1628880917365] GET /etc/designs/testapps/testClientlibs.min.js HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.HtmlLibraryBuilderImpl processing /etc/designs/testClientlibs/testClientlibs with processor gcc for mode min rejected.

Please let me know how can we identify and resolve the minification issues.

11 Replies

Avatar

Level 3

@arunpatidar - Thanks for your reply. I have already followed the instructions in the provided link but no luck. is there a way to find out the errors during the minification process? It only shows the error count but not the error details.

Avatar

Community Advisor

try with

min:gcc;obfuscate=true;languageIn=ECMASCRIPT_2015



Arun Patidar

Avatar

Community Advisor

Hi @test1234567 

 

Did you try with the below option:

jsProcessor="[default:none,min:gcc;languageIn=ECMASCRIPT_2015;compilationLevel=whitespace]"

More information here:

http://www.shsteimer.com/2018/11/29/aem-clientlib-gcc-compiler-options/

 

Thanks! 

Avatar

Level 3

@Asutosh_Jena_ - I just tried with the provided option as well but I still don't see the minificaion on the clientlib.

Avatar

Level 3

@asutosh_jena - It is happening for min:yui but we would like to use gcc as yui is deprecated.

Avatar

Community Advisor

Is it failing on any specific file? Did you check if the file contains any specific keyword which is causing it to fail?

Avatar

Level 3

@Asutosh_Jena_ - After enabling the debug logs, it is failing for the below.

 

ERROR - This language feature is only supported for ECMASCRIPT6 mode or better: const declaration.
const testVar= "Test"

Avatar

Community Advisor

Hi @test1234567 

 

Change the above code to:

vartestVar= "Test"

Now see. 

Avatar

Level 3

@Asutosh_Jena_ - Instead of changing this reference, is there a way to specify the languageIn, languageOut options to handle this scenario.