Неоднозначная ссылка на библиотеку JS: jquery.js

ScalaJS

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.9")

с (после включения jquery-ui dep):

libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % "0.9.0",
jsDependencies += "org.webjars" % "jquery" % 2.2.3 / "jquery.js",
jsDependencies += "org.webjars.bower" % "jquery-ui" % "1.11.4" / "draggable.js"

ошибка при компиляции с fastOptJS:

[error] - Ambiguous reference to a JS library: jquery.js
[error]   Possible paths found on the classpath:
[error]   - META-INF/resources/webjars/jquery/2.2.3/jquery.js
[error]   - META-INF/resources/webjars/jquery/3.0.0-beta1/src/jquery.js
[error]   - META-INF/resources/webjars/jquery/3.0.0-beta1/dist/jquery.js

Я пробовал с этим потоком: Как разрешить неоднозначную ссылку на библиотека JS? и этот Как устранить JS-зависимости между webjar и scala-js jar в проекте SBT?

но это мне не помогло (пока)

ОБНОВЛЕНО: Мой проект сборки со всеми определенными зависимостями

object BuildProject extends Build {

lazy val myPluginProject = Project(id = "my-site", base = file(".")).

settings(   

 version      := "0.1",
 scalaVersion := Versions.scala,

 ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) },

 libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % "0.9.0" exclude("org.webjars","jquery"),
 libraryDependencies += "com.lihaoyi" %%% "upickle" % Versions.upickle,

 libraryDependencies += "com.lihaoyi" %%% "scalatags" % Versions.scalaTags,

 // we will not use use DOM directly so commenting it
 libraryDependencies += "org.scala-js" %%% "scalajs-dom" % Versions.dom,


 jsDependencies += "org.webjars" % "jquery" % Versions.jquery / "jquery.js",

 jsDependencies += "org.webjars.bower" % "jquery-ui" % Versions.jqueryUI / "draggable.js",

  jsDependencies += "org.webjars.bower" % "webcomponents.js" % Versions.webcomponents / "webcomponents-lite.js",

 skip in packageJSDependencies := false,

 jsDependencies += RuntimeDOM,

 scalaJSUseRhino in Global := false ) .enablePlugins(ScalaJSPlugin)}

куда

  val dom = "0.9.0"
  val upickle = "0.4.0"
  val jquery = "2.2.3"
  val jqueryUI = "1.11.4"
  val webcomponents = "0.7.21"

ОБНОВЛЕНИЕ 2 — "2.2.3/jquery.js" + зависит от ON

  jsDependencies += "org.webjars" % "jquery" % Versions.jquery / "2.2.3/jquery.js",

 jsDependencies += "org.webjars.bower" % "jquery-ui" % Versions.jqueryUI / "core.js" dependsOn "META-INF/resources/webjars/jquery/2.2.3/jquery.js",

Затем:

[error]   Possible paths found on the classpath:
[error]   - META-INF/resources/webjars/jquery-ui/1.11.4/ui/core.js
[error]   - META-INF/resources/webjars/jquery/3.0.0-beta1/src/core.js

ОБНОВЛЕНИЕ 3 – "1.11.4/core.js", если:

   jsDependencies += "org.webjars.bower" % "jquery-ui" % Versions.jqueryUI / "1.11.4/core.js" dependsOn "META-INF/resources/webjars/jquery/2.2.3/jquery.js",

тогда:

[error] (compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved: [error] - Missing JS library:
1.11.4/core.js

ОБНОВЛЕНИЕ:

из веб-банки pom.xml,

<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>1.11.1</version>
</dependency>
</dependencies>

Я не вижу, чтобы это зависело от jquery 2.2.3...

--

как пользователь, я думаю, подожду пару лет, чтобы он стал зрелым.


person ses    schedule 15.05.2016    source источник
comment
Хм. Какие еще зависимости у вас есть? Похоже что-то тянет в 3.0.0...   -  person Justin du Coeur    schedule 15.05.2016
comment
Привет, Сес, ты нашел ответ на свой вопрос?   -  person gurghet    schedule 17.05.2016
comment
github.com/Sergey80/scalajs_bug — создал ошибку в репозитории для тестирования   -  person ses    schedule 18.05.2016


Ответы (2)


Ваша зависимость

jsDependencies += "org.webjars" % "jquery" % 2.2.3 / "jquery.js"

неоднозначен, потому что в вашем пути к классам есть несколько файлов, соответствующих суффиксу jquery.js. Вы можете использовать более длинный суффикс, чтобы устранить неоднозначность, например:

jsDependencies += "org.webjars" % "jquery" % 2.2.3 / "2.2.3/jquery.js"

который будет соответствовать только пути

META-INF/resources/webjars/jquery/2.2.3/jquery.js
person sjrd    schedule 15.05.2016
comment
Re 1.11.4/core.js, посмотрите пути в неоднозначной ошибке, должно быть 1.11.4/ui/core.js или проще ui/core.js. - person sjrd; 18.05.2016

Только что использовал другой jquery-ui, в котором есть draggbale.

 jsDependencies += "org.webjars" % "jquery" % Versions.jquery / "jquery.js",
 jsDependencies += "org.webjars" % "jquery-ui" % "1.11.4" / "jquery-ui.js" dependsOn "jquery.js"

И как я использую:

val containerDyn  = jQuery("#launcher-main-container")
containerDyn.asInstanceOf[js.Dynamic].draggable()

И не уверен, почему это потянуло 3.0.0-beta1 деп

person ses    schedule 19.05.2016