Compile LESS with Web Essentials in Visual Studio Error - Cannot call method 'toJSON' of undefined

2.2k Views Asked by At

I just installed Web Essentials in Visual Studio Premium 2013 in order to use LESS css. I renamed my Site.css into Site.less, save and I get Compilation Error occurred (see error list to navigate to the error location):

On the error list: Error 1 RTLCSS: Exception occured: Cannot call method 'toJSON' of undefined Site.less

I am totally new to less and have no idea what the error could be referring to. I have followed some getting started with less in visual studio tutorials and I believe I am not missing any step.

Thanks for your help!

enter image description here

3

There are 3 best solutions below

3
On BEST ANSWER

I found the same bug, running Web Essentials 2.5.2 in VS 2013 Update 4.

Solved by upgrading to WE 2.5.3 for Update 4.

4
On

The method that worked for me is to close the file and reopen it from the solution explorer. Just by renaming the file and trying for it to compile does not work for some reason.

0
On

I had already installed Web Essentials update 4 (e.g. v2.5.3), but still had this issue. For me it was solved after then also installing update for the 'Visual Studio Extensions for Windows Library for Javascript' extension (for x2? hey, I didn't name it :) (to version 1.0.9200).

I did not install this original extension, but I think it was automatically added by installing the Visual Studio 2013 update (I am now at VS2013 4.5.51641). The extension itself was then still an update behind or something.