asual / lesscss-engine

LESS Engine - A Java wrapper for less.js
http://www.asual.com/lesscss
Apache License 2.0
220 stars 66 forks source link

TypeError: Cannot call method "toCSS" of undefined (file:/ <site path> /plugins/lessengine/lib/lesscss-engine-1.3.0.jar!/META-INF/engine.js#36) #29

Closed jfrux closed 12 years ago

jfrux commented 12 years ago

Any reason why this might happen? It's probably something to do with how I'm loading the library using "Javaloader.cfc" but who knows... I'm using 1.3.0

Message TypeError: Cannot call method "toCSS" of undefined (file:/F:/<site path>/plugins/lessengine/lib/lesscss-engine-1.3.0.jar!/META-INF/engine.js#36) Cause com.asual.lesscss.LessException Stacktrace The Error Occurred in file:/F:/Sites/ccpd-dev/plugins/lessengine/lib/lesscss-engine-1.3.0.jar!/META-INF/engine.js: line 36 called fromfile:/F:/Sites/ccpd-dev/plugins/lessengine/lib/lesscss-engine-1.3.0.jar!/META-INF/less.js: line 470 called fromfile:/F:/Sites/ccpd-dev/plugins/lessengine/lib/lesscss-engine-1.3.0.jar!/META-INF/engine.js: line 35

asual commented 12 years ago

Have you ever succeeded running the library using JavaLoader? Otherwise please post a little snippet that introduces this error. There is obviously something wrong but I need to reproduce it somehow and I need to know more.

gitblit commented 12 years ago

I have seen this error too. The reason it happened for me was that I was trying to import a less file that did not exist using

@import "something.less";

halfninja commented 12 years ago

We are also getting this when an imported file has a syntax error. We're currently looking at putting together a test case and possibly a fix if we can work out what's going wrong.

nanoamp commented 12 years ago

Actually, that pull request didn't fix the case of a non-existent file - that needs an extra null check in the exception handling. I've updated the original request.

ripper234 commented 12 years ago

FYI, for anyone reaching this via Google, and has linux servers & Windows dev machines: Make sure your imports have the correct capitalization + always use "/" and never "\" in paths.