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

Exception thrown initialising LESS Engine on 1.5.1 #57

Closed Tzrlk closed 10 years ago

Tzrlk commented 10 years ago

I encountered this exception after upgrading from 1.3.0 (where imports didn't work), to 1.5.1.

[main] DEBUG com.asual.lesscss.LessEngine - Initializing LESS Engine.
[main] DEBUG com.asual.lesscss.compiler.RhinoCompiler - Using implementation version: Rhino 1.6 release 7 2007 08 19
[main] ERROR com.asual.lesscss.LessEngine - LESS Engine intialization failed.
org.mozilla.javascript.EcmaError: TypeError: Cannot find function bind. (file:/C:/Users/pcummuskey/.m2/repository/com/asual/lesscss/lesscss-engine/1.5.1/lesscss-engine-1.5.1.jar!/META-INF/source-map.js#152)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
    at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3356)
    at org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntime.java:3368)
    at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3428)
    at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2052)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3081)
    at script(file:/C:/Users/pcummuskey/.m2/repository/com/asual/lesscss/lesscss-engine/1.5.1/lesscss-engine-1.5.1.jar!/META-INF/source-map.js:152)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2394)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
    at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:173)
    at org.mozilla.javascript.Context.evaluateReader(Context.java:1227)
    at com.asual.lesscss.compiler.RhinoCompiler.<init>(RhinoCompiler.java:32)
    at com.asual.lesscss.LessEngine.<init>(LessEngine.java:84)
    at com.asual.lesscss.LessEngine.<init>(LessEngine.java:58)
    at com.asual.lesscss.LessEngine.<init>(LessEngine.java:54)
asual commented 10 years ago

This is very likely caused by an old Rhino version in your classpath. The library is tested against "Rhino 1.7 release 4 2012 06 18".

Tzrlk commented 10 years ago

I don't know why an old version of Rhino would be on the classpath. I've got the rhino-1.7R4 artefact being brought in (maven build), so it reporting 1.6 on the console, and referencing everything from the 1.7 jar is a little confusing. Though it does look like my IDE is doing some stupid caching. I'll update again when I've looked into it further.

Tzrlk commented 10 years ago

Found it. com.yahoo.platform.yui:yuicompressor brings in rhino:js:jar:1.6R7.