You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recommend that all parsing/loading/init errors in "production" to be output directly to window.console, i.e. using window.console.warn().
Background: I've lost a 2 hours trying to debug less installation. It boiled down to some typo which caused parsing error. less.js client-side script should never fail silently in default enviroment ("production") - this currently creates ambiguity (has js loaded? have less files loaded? is there a browser problem? etc.)
The only workaround I've found for quick debugging - in browser's js console type less.env = "development"; followed by less.refresh();
The better and easier option might be to develop using a server-side LESS compiler. Also, like you said, you can trigger a "development" mode in-browser as well.
The whole point of less.js is to allow client-side less loading and processing (as in: development, although some sites are also using it for production).
There is nothing easier in using a server-side less compiler, especially when someone is already spending a lot of time in a js debugger (like webkit dev console or firebug), fiddling with styles and scripts.
Development mode in current version is terrible! Those huge error messages are destructive to DOM, AFAIR they attach to for some reason and there is no easy way to get rid of them. All extensions, analyzers and devel tools use window.console and Console.log() is like 6 years old :-)
I don't even want to mention LESS watch mode which is used for exactly this purpose - to make reloading and testing less templates faster. But I don't see errors unless I enable devel mode which in turns destroys the whole markup.
I recommend that all parsing/loading/init errors in "production" to be output directly to
window.console
, i.e. usingwindow.console.warn()
.Background: I've lost a 2 hours trying to debug less installation. It boiled down to some typo which caused parsing error.
less.js
client-side script should never fail silently in default enviroment ("production") - this currently creates ambiguity (has js loaded? have less files loaded? is there a browser problem? etc.)The only workaround I've found for quick debugging - in browser's js console type
less.env = "development";
followed byless.refresh()
;Reference: http://getfirebug.com/wiki/index.php/Console_API
The text was updated successfully, but these errors were encountered: