Picture of Greg Sweet
Framework issue: less OperationError during grunt build
by Greg Sweet - Wednesday, 16 December 2015, 4:38 PM
 

 Framework version 2.0.7

When I attempt the grunt build command to do the initial build of the example course I am getting a less OperationError as below:

$ Running "less:dist" (less) task
$ >> OperationError: Operation on an invalid type in src/less/adapt.less on line 9540, column 3:
$ >> 9539 position:relative; 
$ >> max-width: (@device-width-large / 2) - (@item-padding *2);
$ >> margin:auto;
$ Warning: Error compiling src/less/adapt.less Use --force to continue.

$ Aborted due to warnings.

I found some info via google that suggested adding strictMath:true to the gruntfile.js, and when strictMath is in place this error is kicked down the road a bit to line 9569.

I am not real familiar with less, and will do more research, but thought I'd ask here just in case it's an easy fix.

Thanks,

Greg

 

Picture of Matt Leathes
Re: Framework issue: less OperationError during grunt build
by Matt Leathes - Wednesday, 16 December 2015, 5:49 PM
 

I've just pulled down the framework and tried building it... no problems for me.

Have you modified what you brought down? You seem to have a lot more lines in your adapt.less than I do!

A colleague mentioned that LESS might have issues with spaces around mathematical operators - which you do have in the max-width line above.

Picture of Greg Sweet
Re: Framework issue: less OperationError during grunt build
by Greg Sweet - Wednesday, 16 December 2015, 6:59 PM
 

There are 12705 lines the adapt.less file and no I did not make an changes to it. 

I am attempting to build the default course so I can start working through the tutorials.

I removed the spaces from the line in question and ran the build. It bombed out at the same spot again, so I reopened adapt.less in my IDE (Brackets) and noticed the spaces were back, so I tried again. This time I left the adapt.less open in the IDE when I ran $ grunt build and physically saw the spaces added back into the adapt.less file immediately before the grunt build reported the error.

I've attached a video of it happening. I know it doesn't help solve the problem, but it's too weird not to share.

Picture of Matt Leathes
Re: Framework issue: less OperationError during grunt build
by Matt Leathes - Wednesday, 16 December 2015, 7:51 PM
 

Sadly quicktime doesn't want to initialize and show me that video!

My understanding is that adapt.less is generated from all the other .less files in the src folder by the build process. It then takes this single files and generates build/adapt/css/adapt.css from it... I think anyway, this is not really my area of Adapt expertise.

So, the spaces probably originate in one of the other .less files. But if you are just using the downloaded framework that you get with $ adapt create course with no modifications then I doubt it's anything to do with that, otherwise I should be getting the same issue.

My adapt.less only has 3991 lines in it. Maybe it's shorter once the compilation process has finished?

Sorry I can't help more, like I say this is not an area of Adapt I know a lot about. If you don't get any more responses on here you could always try the chat room.

Picture of Matt Leathes
Re: Framework issue: less OperationError during grunt build
by Matt Leathes - Wednesday, 13 January 2016, 10:29 AM
 

Hi Greg

Are you still getting this issue? If so, I came across this post today - which sounds like a very similar issue.