Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Minification failing for third party JS

Avatar

Avatar
Validate 10
Level 3
anilkum
Level 3

Likes

3 likes

Total Posts

65 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 3
anilkum
Level 3

Likes

3 likes

Total Posts

65 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
anilkum
Level 3

16-09-2016

Hi,

We have third party JS files in out project. When we are configuring the Felix console to minify the JS, the minified JS is not getting loaded in the page. Felix uses YUI compressor and when we tested it with online minifier that uses YUI compressor we were able to replicate the error.

However some other minifier e.g. https://javascript-minifier.com/ was able to minify this particular JS without any problem.

What is workaround? Is it possible to configure AEM not to use YUI for minification?

Has anyone faced such issue. Please respond.

AEM version 6.0 SP2.

Regards,

Anil 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
JE_Bailey
Level 2

Likes

10 likes

Total Posts

26 posts

Correct Reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
JE_Bailey
Level 2

Likes

10 likes

Total Posts

26 posts

Correct Reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
JE_Bailey
Level 2

17-04-2017

We've encountered minification problems as well. We've identified the root cause as being a key in a js object called extends. 

Example of a snippet would be 

var foo ={ extends: 'div' }

Other minification processes wraps the extends with quotes.

var foo ={ "extends": 'div' }

We've used that wrapping as quotes as a workaround in our own code base to allow the minification to work as expected

Answers (5)

Answers (5)

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

21-12-2016

What you can consider too, is to disable minify on publish. And to do this on Apache.

Avatar

Avatar
Level 1
wang_pei
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
wang_pei
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
wang_pei
Level 1

20-12-2016

Hi Feike,

I also meet this problem recently. I can use the Uglify to compress my Js file, it will fails when I try to use YUI compressor.

The file I want to compressed invoke React, And I already use babel to translate it to ES5 synax.

As you know the YUI Compressor is already stopping upgrades long time ago, maybe it not supports the new tech.

Is there any solution I can replace YUI on AEM?

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

17-09-2016

Please check the error.log file, to check if you see a message around this. Then you know what is causing the minification to fail.

Avatar

Avatar
Validate 10
Level 3
anilkum
Level 3

Likes

3 likes

Total Posts

65 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 3
anilkum
Level 3

Likes

3 likes

Total Posts

65 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
anilkum
Level 3

16-09-2016

The third party JS seems to be an already minified version. Will check with an unminified version. Does YUI fails when processing a minified version of file.

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

16-09-2016

Do you see something in the log around this?

Usually there are syntax errors that cause the minification to fail.