Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Less isn't showing me its errors

Tags:

less

When using client-side compilation for less, and if there are errors, Less is not showing me what those errors are. It's supposed to insert some HTML, but it seems not to be doing this. The HTML on the page after Less runs looks like:

<html>
  <head>
  <link rel="stylesheet/less" type="text/css" href="/Content/less/all.less">
  <script src="/Content/js/libs/less-1.3.0.min.js" type="text/javascript"></script>
  <style type="text/css" media="screen" id="less:error-message">
   --SNIP--
  }</style>
  </head>
  <body>         
  </body>
</html>

As you can see, the less error css is generated, but not the html.

like image 746
heneryville Avatar asked May 10 '12 22:05

heneryville


1 Answers

Add this script before including less.js in your head:

<script type="text/javascript">less = { env: 'development' };</script>

This tells less.js that it is OK to display error messages in the browser as we are still dev'ing the page.

like image 144
user1267519 Avatar answered Oct 01 '22 13:10

user1267519