ScalablyTyped / Converter

Typescript to Scala.js converter
https://scalablytyped.org
GNU General Public License v3.0
222 stars 44 forks source link

Conflicting dependency on scala-java8-compat #387

Closed nafg closed 2 years ago

nafg commented 2 years ago

It seems beta34 and later conflict with sbt-web-scalajs-bundler 0.20.0.

I get this error:

[error] stack trace is suppressed; run last update for the full output
[error] (update) found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error] 
[error]     * org.scala-lang.modules:scala-java8-compat_2.12:1.0.0 (early-semver) is selected over 0.8.0
[error]         +- org.scalablytyped.converter:sbt-converter:1.0.0-beta34 (sbtVersion=1.0, scalaVersion=2.12) (depends on 1.0.0)
[error]         +- com.typesafe.akka:akka-actor_2.12:2.5.17           (depends on 0.8.0)
[error] 
[error] 
[error] this can be overridden using libraryDependencySchemes or evictionErrorLevel

Which comes from sbt-web-scalajs-bundler:

sbt:project> whatDependsOn com.typesafe.akka akka-actor_2.12
[info] com.typesafe.akka:akka-actor_2.12:2.5.17 [S]
[info]   +-com.typesafe.sbt:sbt-web:1.4.4
[info]     +-com.vmunier:sbt-web-scalajs:1.1.0
[info]       +-ch.epfl.scala:sbt-web-scalajs-bundler:0.20.0
[info]         +-default:project:0.1.0-SNAPSHOT

With this plugins.sbt:

//addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")

addSbtPlugin("org.scala-js"                % "sbt-scalajs"             % "1.8.0")
//addSbtPlugin("org.portable-scala"          % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("ch.epfl.scala"               % "sbt-web-scalajs-bundler" % "0.20.0")
addSbtPlugin("org.scalablytyped.converter" % "sbt-converter"           % "1.0.0-beta34")
oyvindberg commented 2 years ago

Thanks for the report.

At this point sbt authors should just publish a list of which exact versions of dependencies should be used by all sbt plugins. Because if you dare upgrade a single one you'll break all the plugins which didn't upgrade.

This can be fixed by reverting the update of the dependency in this project, or by updating it for sbt-web-scalajs-bundler. Given two non-great options I prefer the latter I guess. Otherwise I'd accept a PR with a downgrade at this side too.

nafg commented 2 years ago

Either that or every sbt plugin should shade all its dependencies or run in its own classloader.

Don't downgrade. However long it takes, it's better to figure out the right way.

So far I've discovered that:

Then again, scalajs-bundler is pretty stagnated too. It really needs to be updated somehow.