2

I've been using scalajs-dom v 0.8.1 and trying to mix webjars within my SBT project. When I do this, I'm getting one final ambiguous JS reference that I can't figure out. I think it is between the webjars I want to use (that include jquery v 2.1.4) and scala-js. I tried using the ManifestFilters SBT filter but it does not seem to help (or I don't know the correct syntax). Does anyone have a useful way to debug these kinds of errors? (see below for SBT output when issuing the 'fastOptJS' task)

[error] - Ambiguous reference to a JS library: jquery.js
[error]   Possible paths found on the classpath:
[error]   - META-INF/resources/webjars/jquery/2.1.4/dist/jquery.js
[error]   - META-INF/resources/webjars/jquery/2.1.4/src/jquery.js
[error]   originating from: spJS:compile, spJS:compile
bjenkins001
  • 141
  • 1
  • 9

1 Answers1

1

Specifying the specific subpath for jquery.js should disambiguate when pulling down webjar dependencies.

jsDependencies += "org.webjars" % "jquery" % "2.1.4" / "dist/jquery.js"

see: https://github.com/scala-js/scala-js/issues/1496

James Ward
  • 29,283
  • 9
  • 49
  • 85
Julie
  • 6,221
  • 3
  • 31
  • 37
  • Thanks for that tip. Unfortunately it did not work for me. I was trying to use a fancy file upload library that needed org.webjars.bower components and so I was trying the bower version of jquery. Maybe that has something to do with it (I don't know how bower works--all I know is by finding 'bower' versions of webjars, the ambiguities went away except for the jquery one). Thanks for your help. – bjenkins001 Oct 18 '15 at 13:04