Expand my Community achievements bar.

SOLVED

After Jquery upgrade using minification the site is breaking.

Avatar

Level 4

Hi,

 

We are using AEM 6.1, jQuery 1.12.4 version. There is a requirement to upgrade jQuery to 3.5 + and followed https://jquery.com/upgrade-guide/3.0/ .

So when tried upgrading to jquery-3.6.0.min.js version without minification in Adobe Granite HTML library  the site is working fine. But when minification is turned on the site is breaking and i found out the error we are getting in jQuery minification file i.e.,

 

sreekalyanip_0-1653320106372.png

Any clue on how to solve this minification problem

 

Regards,

Sree.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @sreekalyanip ,

 

Looks like the issue is being surely caused by minification and since Adobe Granite HTML library uses YUI compressor to perform minification.


I got to know that there are some reserved words with YUI compressor which can lead to such errors.
References to support my statement:
https://stackoverflow.com/questions/424469/compression-issues-with-jquery-file-in-yui-compressor

https://stackoverflow.com/questions/10744930/yui-compressor-errors-jquery-autotype

 

You can try using the already minified version published avilable here :

https://code.jquery.com/jquery-3.6.0.min.js

and try to check if the issue persists.

Thanks,

Milind

View solution in original post

3 Replies

Avatar

Community Advisor

Hi,

 

Try to disable the jquery minification. Also it is recommended to upgrade AEM as AEM 6.1 is very old version and it will not support latest versions of jquery. You might see some features not working correctly, even when the js error is fixed.

 

You can try to use out of the box jquery for authoring and latest jquery for publish pages

Avatar

Correct answer by
Employee Advisor

Hi @sreekalyanip ,

 

Looks like the issue is being surely caused by minification and since Adobe Granite HTML library uses YUI compressor to perform minification.


I got to know that there are some reserved words with YUI compressor which can lead to such errors.
References to support my statement:
https://stackoverflow.com/questions/424469/compression-issues-with-jquery-file-in-yui-compressor

https://stackoverflow.com/questions/10744930/yui-compressor-errors-jquery-autotype

 

You can try using the already minified version published avilable here :

https://code.jquery.com/jquery-3.6.0.min.js

and try to check if the issue persists.

Thanks,

Milind

Avatar

Level 4

Hi @milind_bachani

Tried using 3.6.0.min.js. 

Without the minify option in Adobe Granite HTML Library it is working fine. But when minify option is enabled then the site is breaking the errors are arising in in jQuery library files.

Even now the issue is not solved.

 

Regards,
Sree