irundaia / sbt-sassify

sbt-web plugin for Sass files
Apache License 2.0
68 stars 17 forks source link

CSS not compiled with v1.4.x & NoSuchMethodError with v1.5.0 #46

Closed Wangchimei closed 4 years ago

Wangchimei commented 4 years ago

First of all, I am not familiar with Play yet, so please bear with me if this seems like a beginner question.

Since we are working with Sass with Play, we have included this plugin in our project according to the Play and sbt-sassify documentation.

Please see our project built as below,

I tried using sbt-sassify 1.4.12 and 1.4.13 yesterday. Af first, I ran sbt run, but under public/stylesheets, the compiled CSS was not being generated. I tried using sbt assets as well, but it did not seem like the compiler was executing.

[info] Loading settings for project ui-build from plugins.sbt ...
[info] Loading project definition from /Users/xxxx/xxx/xx/project
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Loading settings for project root from build.sbt ...
[info] Set current project to xx (in build file:/Users/xxxx/xxx/xx/)
[success] Total time: 1 s, completed

Today, I tried using sbt-sassify v1.5.0 instead, and when I ran sbt assets, sass compiling seemed to start to run, but soon NoSuchMethodError was shown.

[info] Sass compiling on 1 source(s)
[error] java.lang.NoSuchMethodError: com.sun.jna.Native.load(Ljava/lang/String;Ljava/lang/Class;)Lcom/sun/jna/Library;
[error]         at org.irundaia.sass.SassCompiler$.<init>(SassCompiler.scala:44)
[error]         at org.irundaia.sass.SassCompiler$.<clinit>(SassCompiler.scala)
[error]         at org.irundaia.sbt.sass.SbtSassify$.$anonfun$baseSbtSassifySettings$10(SbtSassify.scala:100)
[error]         at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
[error]         at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
[error]         at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
[error]         at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
[error]         at scala.collection.TraversableLike.map(TraversableLike.scala:238)
[error]         at scala.collection.TraversableLike.map$(TraversableLike.scala:231)
[error]         at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error]         at org.irundaia.sbt.sass.SbtSassify$.$anonfun$baseSbtSassifySettings$8(SbtSassify.scala:100)
[error]         at com.typesafe.sbt.web.incremental.package$.syncIncremental(package.scala:228)
[error]         at org.irundaia.sbt.sass.SbtSassify$.$anonfun$baseSbtSassifySettings$6(SbtSassify.scala:140)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error]         at sbt.Execute.work(Execute.scala:290)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (Web-assets / sassify) java.lang.NoSuchMethodError: com.sun.jna.Native.load(Ljava/lang/String;Ljava/lang/Class;)Lcom/sun/jna/Library;

I am assuming that I am missing something on the configuration. I would really appreciate it if you could help me to see if I made an oversight here.

irundaia commented 4 years ago

What os + jdk are you using? I'll try to reproduce, and fix your issues later today. With version 1.5.0 I rewrote how we load the native libsass library, because of a deprecation warning on the old method. However, I notice that the new method isn't available on the Native class on your classpath. I'll need to do some investigation though.

Wangchimei commented 4 years ago

Thank you very much for investigating this. I am using macOS 10.15.4 and JDK 8 (java version "1.8.0_241").

Wangchimei commented 4 years ago

Just a quick update to the current status, our team got the v1.4.x working perfectly with our project. What was preventing the plugin from compiling scss was actually the stylesheets folder under public folder that we used to use (generated by another compiler). Once the folder was deleted completely, it worked like a charm. :) As for v1.5.0, NoSuchMethodError and NoClassDefFoundError are still showing.

irundaia commented 4 years ago

I can reproduce your issue with version 1.5.0. I've reverted the way that the native library is loaded. For me, this fixed the issue with compiling in your setup. Could you have a look at whether this fixed your problems as well, using version 1.5.1?

Wangchimei commented 4 years ago

It works now. Thank you so much. :)