AEM with Bootstrap 3 and LESS does not compile. Any fixes? | Community
Skip to main content
digital_lab
October 16, 2015
Solved

AEM with Bootstrap 3 and LESS does not compile. Any fixes?

  • October 16, 2015
  • 5 replies
  • 3074 views

I have tried this in both AEM 5.6.1 and AEM 6 (load 18), but it behaves (errors) the same.

I'm trying to use Bootstrap 3 and LESS (the built-in compiler via rhino) and it keeps coming up with compilation errors due to the following 'extend' method, which was introduced in LESS version 1.4:

&:extend(.clearfix all);

When I was using AEM 5.6.1 I tried to update the version of LESS that is being used by going to /system/console, looking for the UI Commons bundle, unpackaging it, editing the "less-1.3.3.js" file, and re-packaging / re-uploading it, but that didn't work either (it behaves the same after a server reboot).
Is there any way to fix this without compiling LESS somewhere else (I'd rather not compile via Maven build). 

Thanks,
Ryan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

 Why don't you have own client lib with version you want?

When re-packed make sure the file name for less is less-1.3.3.js  plus You need to uninstall & install the bundle from felix console & Delete everything under /var/clientlibs/* from crxde light & Save the changes. Also restart the bundle. 

Note:-  repacking the factory bundle will impact support & you might not get official assistance. Use with precaution.

5 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

 Why don't you have own client lib with version you want?

When re-packed make sure the file name for less is less-1.3.3.js  plus You need to uninstall & install the bundle from felix console & Delete everything under /var/clientlibs/* from crxde light & Save the changes. Also restart the bundle. 

Note:-  repacking the factory bundle will impact support & you might not get official assistance. Use with precaution.

msullivan-r2i
Level 2
October 16, 2015

I've been using a different approach of using a lesscss-maven-plugin as part of my maven build process to compile less since before it was included out of the box with clientlibs. I've found it pretty bullet proof, easily upgraded to the latest version though configuration, and most importantly it finds compilation errors at buld time.

https://github.com/shoebappa/lesscss-maven-plugin-example

digital_lab
October 16, 2015

Do you know what bundle LESS lives in in AEM 6? I was able to find it under "Granite UI Commons" in AEM 5.6.1, but since upgrading to AEM 6 I cannot find it anymore.

msullivan-r2i
Level 2
October 16, 2015

Adobe Granite UI Commons (com.day.cq.cq-widgets)

digital_lab
October 16, 2015

Haha, right after I posted that question I went and looked there. It isn't searchable in the browser like it was in AEM 5.6.1, but yep, it's still there.

Now my issue is when I update the less javascript to the newest version and try to re-upload the bundle it fails, returning a 500 error. When I try to re-upload the original bundle (with the old LESS), it works fine.

So frustrating.