Haspemulator Haspemulator - 1 year ago 112
Scala Question

Scala.js cross-project wrong dependency

In my

I have a cross-project (js + jvm), and I depend on the jvm part in my other project (let’s call it
). Here’s the part of my

lazy val common = (crossProject in file(“common”)).enablePlugins(ScalaJSPlugin)
lazy val common_js = common.js
lazy val common_jvm = common.jvm
lazy val events = (project in file (“events)).dependsOn(common_jvm)

But this setup fails when I do
sbt events/assembly
. The error is as follows:

java.lang.RuntimeException: deduplicate: different file contents found in the following:

If I do the
, I see my
project depends on
, and the aforementioned
comes transitively from it.
So it seems my common js dependency creeps in somehow, even though I haven't specified it. What am I doing wrong?

Answer Source

You are probably specifying the ScalaJSPlugin on the JVM project, either directly or via crossProject. The plugin is only needed when creating a regular SBT project, as crossProject includes it automatically for the JS subproject.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download