Hi,
JS minify is not happening in AEM 6.5.2 instance for our project. I tried with gcc (min:gcc;languageIn=ECMASCRIPT6) with Adobe Granite HTML Library Manager and also tried with default minify (min:yui). Both seems not working.
Thanks in Advance.
Views
Replies
Total Likes
Could you please try to minify your js here-
https://www.freeformatter.com/javascript-minifier.html
If it works here then we can check in aem , nor it should not work online only there must be some error in your js file, due to which you are not able to minify the js.
Views
Replies
Total Likes
Views
Replies
Total Likes
The following is the error that i can see it in error.log but the error is very uncertain. Very rarely i get this.
ERROR [com.adobe.granite.ui.clientlibs.processor.gcc.impl.GCCScriptProcessor] Error setting compiler options for flags {minify=true, languageIn=ECMASCRIPT6}: No enum constant com.google.javascript.jscomp.CompilerOptions.LanguageMode.ECMASCRIPT6
DEBUG [com.adobe.granite.ui.clientlibs.impl.HtmlLibraryBuilderImpl] processing {My clientlibrary path} with processor gcc for mode min rejected.
Tried with min:yui and i could not see any errors but no result either.
Hi @divyas70997717 ,
I see that you are trying to use ECMASCRIPT6 as an option for gcc.
"gcc" stands for Google Closure Compiler. There seems to be no ECMASCRIPT6 option for languageIn, you'll have to pick one from the following list (which I got from the documentation on GCC's GitHub page
ECMASCRIPT3
ECMASCRIPT5
ECMASCRIPT5_STRICT
ECMASCRIPT6_TYPED (experimental)
ECMASCRIPT_2015
ECMASCRIPT_2016
ECMASCRIPT_2017
ECMASCRIPT_2018
ECMASCRIPT_2019
STABLE
ECMASCRIPT_NEXT
ECMASCRIPT_2015 is equivalent to ES6 btw: https://www.w3schools.com/js/js_es6.asp
Hope this helps, let me know
I am too facing the same issue. Here it is from log.
10.06.2020 14:40:34.526 *INFO* [202.174.120.2 [1591800034525] GET /etc.clientlibs/appName/clientlibs/clientlib-base.min.css HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl Start building CSS library: /apps/appName/clientlibs/clientlib-base (minified)
10.06.2020 14:40:36.192 *INFO* [202.174.120.2 [1591800034525] GET /etc.clientlibs/appName/clientlibs/clientlib-base.min.css HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl finished building library /apps/appName/clientlibs/clientlib-base.css
10.06.2020 14:40:41.441 *INFO* [202.174.120.2 [1591800041441] GET /etc.clientlibs/appName/clientlibs/clientlib-base.min.js HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl Start building JS library: /apps/appName/clientlibs/clientlib-base (minified)
10.06.2020 14:40:41.444 *ERROR* [202.174.120.2 [1591800041441] GET /etc.clientlibs/appName/clientlibs/clientlib-base.min.js HTTP/1.1] com.adobe.granite.ui.clientlibs.processor.gcc.impl.GCCScriptProcessor Error setting compiler options for flags { languageOut=ECMASCRIPT_2019, minify=true, languageIn=ECMASCRIPT_2019, compilationLevel=advanced}: No enum constant com.google.javascript.jscomp.CompilerOptions.LanguageMode.ECMASCRIPT_2019
10.06.2020 14:40:41.449 *INFO* [202.174.120.2 [1591800041441] GET /etc.clientlibs/appName/clientlibs/clientlib-base.min.js HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl finished building library /apps/appName/clientlibs/clientlib-base.js
Hi, any update on this? I have the same issue now. On gcc compiler site, my scritpts compiled fine. and on my clientlibrary folder, no matter what I set: min:gcc;languageIn=ECMASCRIPT_2016;languageOut=ECMASCRIPT3.
The javscript file doesn't compiled during runtime. Any idea?
Hi,
If there are any compilation error seen in the AEM error log, try fixing it. If there are no error then just try with option min:gcc and no other language parameter. To recompile in the AEM instance put a space and save the original JS source file GCC option will try to compile and minify it.
No luck, still the same, es6 javascript not got transcompiled and forms rule editor still cannot be opened due to AEM thinks it is a syntax error.
Suggested to create an Adobe AEM support ticket or you can try minify as part of your codebase build release as a workaround solution. We had tried these language options for ES6 javascripts but had come across similar issues.
Thanks, opened a ticket to Adobe support already. Seems for now, we have to gcc ourselves and put the compiled code in the client library.
problem resolved:
In HTML library manager, change the default jsProcessor to min:gcc.
Then for client library folder, add the following:
jsProcessor=[min:gcc;obfuscate=true;languageIn=ECMASCRIPT_2019;languageOut=ECMASCRIPT3]
then application works. At least AEM js compiler syntax check passed for this configuration.
Ok nice. But curios to know with this configuration is it really compressing the JS as part of minification?
No, just the AEM forms rules editor can pass the validation, the final output *.min.js still not minified and the client library source code showed on the final publisher page. Seems need more dig into it. ^_^
I enabled the Minify on the HTML client library manager, still, the ecmascript_2019 source code passthrough to the final page javscript file. no minify and no transcompile.
Views
Likes
Replies