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

How can we disable strict mode while running min:gcc

Avatar

Avatar
Boost 1
Level 1
johns43992246
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
johns43992246
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
johns43992246
Level 1

05-04-2019

We configured our AEM instance to use these OSGi configurations

com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.xml

htmllibmanager.minify="{Boolean}true"

htmllibmanager.processor.js="[min:gcc;languageIn=ECMASCRIPT_2015]"

The minify errors and when it encounters

05.04.2019 12:24:41.774 *ERROR* [0:0:0:0:0:0:0:1 [1554481481510] GET /content/xxxx/xxxx/us/en/xxxxxx/home.html HTTP/1.1] com.google.javascript.jscomp /etc/designs/sites/xxxxxxxx/main/script.js:4023: ERROR - Object literal contains illegal duplicate key "background", disallowed in strict mode                                             background: "-moz-linear-gradient(" + oldBrowsers + ")",

Also it errors here

05.04.2019 12:20:12.114 *WARN* [0:0:0:0:0:0:0:1 [1554481211211] GET /content/xxx/xxxxx/us/en/xxxxxx/home.html HTTP/1.1] com.google.javascript.jscomp /etc/designs/sites/xxxx/xxxxx/main/script.js:3349: WARNING - Parse error. String continuations are not recommended. See https://google.github.io/styleguide/javascriptguide.xml?showone=Multiline_string_literals#Multiline_...         var modalHTML = '\                         ^

We can eliminate these errors if we refactor the code.

Is there a way to configure min:gcc avoid these JavaScript Parsing Errors and still use min:gcc?

Replies

Avatar

Avatar
Give Back 50
Employee
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 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
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Vish_dhaliwal
Employee

05-04-2019

Hello,

Try by setting strict_mode_input=false.

How to Enable and Use GCC Strict Mode Compilation – Shital Shah

Regards,

Vishu

Avatar

Avatar
Boost 1
Level 1
johns43992246
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
johns43992246
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
johns43992246
Level 1

05-04-2019

Thanks Vishu, I tried adding the parameter to the jsProcessor in the HTML Manager

min:gcc;languageIn=ECMASCRIPT_2015;strict_mode_input=false

I get the same errors with this configuration. Is there another place I should input the strict_mode_input=false ?

Avatar

Avatar
Give Back 50
Employee
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 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
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Vish_dhaliwal
Employee

05-04-2019

Not sure John.

According to docs: 

  • Now ES6 language mode defaults to strict mode. If you don't want strict mode checks, use the --strict_mode_input=false flag.
  • Allow --strict_mode_input flag to work in all language modes, including ES3.

Avatar

Avatar
Give Back 50
Employee
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 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
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Vish_dhaliwal
Employee

05-04-2019

Might be some issue with the format. Also, try to clear cache and rebuild clientlibs.