lihaoyi / workbench-example-app

An example application written in ScalaJS using scala-js-dom and scala-js-workbench
204 stars 109 forks source link

Implicit conversions not applicable for the TodoMVC #11

Closed mathieuleclaire closed 10 years ago

mathieuleclaire commented 10 years ago

Hi, the todoMVC example does not compile due to an implicit conversion conflict:

found   : org.scalajs.dom.HTMLInputElement
[error]  required: scalatags.JsDom.Node
[error]     (which expands to)  scalatags.generic.Node[org.scalajs.dom.Element]
[error] Note that implicit conversions are not applicable because they are ambiguous:
[error]  both method bindElement in trait LowPriorityImplicits of type (e: org.scalajs.dom.Element)scalatags.generic.Node[org.scalajs.dom.Element]
[error]  and method NumericNode in object JsDom of type [T](u: T)(implicit evidence$1: Numeric[T])scalatags.JsDom.StringNode
[error]  are possible conversion functions from org.scalajs.dom.HTMLInputElement to scalatags.JsDom.Node
[error]             inputBox,
lihaoyi commented 10 years ago

Could you try updating the build.sbt dependency on Scalatags from 0.3.0 to 0.3.8? Alternatively, try updating the scalaVersion to 2.11.1.

There is a bug in 2.10.x w.r.t. type-inference that got fixed in 2.11.x, and also got fixed in 0.3.something (I forgot which one). Let me know if it doesn't work for you. Also, if it does work for you, please send a PR =)

lihaoyi commented 10 years ago

Looks like it was fixed in 0.3.2 and above https://github.com/lihaoyi/scalatags/issues/23

lihaoyi commented 10 years ago

I just cloned and ran it and it worked, because of the scalaVersion := 2.11.1 in built.sbt.

mathieuleclaire commented 10 years ago

A dependency is still not found for me (you may get it in your .ivy2/local folder).

sbt.ResolveException: unresolved dependency: com.typesafe.play#play-json_2.10;2.2.2: not found
lihaoyi commented 10 years ago

Should be fixed by https://github.com/lihaoyi/workbench-example-app/pull/10

mathieuleclaire commented 10 years ago

Actually not, I still have the same error. Did you try to clone the project on the todomvc branch and to compile it from scratch ?

lihaoyi commented 10 years ago

Yeah I did

mathieuleclaire commented 10 years ago

It's really weird, cause I trashed my .ivy2 and rebuild from scratch with a freshly cloned project and the dependency is still not resolved.

mathieuleclaire commented 10 years ago

Adding a plugins.sbt in a project directory with :

resolvers += "Typesafe repository" at
  "http://repo.typesafe.com/typesafe/releases/"

fixes the problem. I didnt succeed in doing a pull request for a particular branch (I don't know if it is doable !)