{"action":"created","issue":{"url":"https://api.github.com/repos/scala-js/scala-js/issues/2275","repository_url":"https://api.github.com/repos/scala-js/scala-js","labels_url":"https://api.github.com/repos/scala-js/scala-js/issues/2275/labels{/name}","comments_url":"https://api.github.com/repos/scala-js/scala-js/issues/2275/comments","events_url":"https://api.github.com/repos/scala-js/scala-js/issues/2275/events","html_url":"https://github.com/scala-js/scala-js/issues/2275","id":137662535,"number":2275,"title":"Disambiguate \"top level\" webjar dependencies via jsDependencies","user":{"login":"landlockedsurfer","id":3172001,"avatar_url":"https://avatars.githubusercontent.com/u/3172001?v=3","gravatar_id":"","url":"https://api.github.com/users/landlockedsurfer","html_url":"https://github.com/landlockedsurfer","followers_url":"https://api.github.com/users/landlockedsurfer/followers","following_url":"https://api.github.com/users/landlockedsurfer/following{/other_user}","gists_url":"https://api.github.com/users/landlockedsurfer/gists{/gist_id}","starred_url":"https://api.github.com/users/landlockedsurfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landlockedsurfer/subscriptions","organizations_url":"https://api.github.com/users/landlockedsurfer/orgs","repos_url":"https://api.github.com/users/landlockedsurfer/repos","events_url":"https://api.github.com/users/landlockedsurfer/events{/privacy}","received_events_url":"https://api.github.com/users/landlockedsurfer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scala-js/scala-js/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-01T19:24:36Z","updated_at":"2016-03-01T22:27:12Z","closed_at":null,"body":"Hi!\r\n\r\nI ran into an issue with the following `build.sbt` file:\r\n\r\n```\r\nlazy val root = project.in(file(\".\")).enablePlugins(ScalaJSPlugin)\r\n\r\nname := \"jsdeps\"\r\n\r\nlibraryDependencies ++= Seq(\r\n  \"org.scala-js\" %%% \"scalajs-java-time\" % \"0.1.0\"\r\n)\r\n\r\njsDependencies ++= Seq(\r\n\"org.webjars\" % \"jquery\" % \"2.1.4\" / \"jquery.js\",\r\n\"org.webjars\" % \"bootstrap\" % \"3.3.4\" / \"bootstrap.js\" minified \"bootstrap.min.js\" dependsOn \"jquery.js\",\r\n\"org.webjars.bower\" % \"bootstrap-daterangepicker\" % \"2.1.17\" / \"daterangepicker.js\" dependsOn \"bootstrap.js\"\r\n)\r\n```\r\nRunning the `fastOptJs` task returns\r\n```\r\n[error] (compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:\r\n[error] - Ambiguous reference to a JS library: jquery.js\r\n[error]   Possible paths found on the classpath:\r\n[error]   - META-INF/resources/webjars/jquery/3.0.0-beta1/src/jquery.js\r\n[error]   - META-INF/resources/webjars/jquery/3.0.0-beta1/dist/jquery.js\r\n[error]   - META-INF/resources/webjars/jquery/2.1.4/jquery.js\r\n```\r\nThe closed issue #1496 helped me resolve the problem by prepending `dist` to the jQuery dependency like this:\r\n\r\n```\r\nlazy val root = project.in(file(\".\")).enablePlugins(ScalaJSPlugin)\r\n\r\nname := \"jsdeps\"\r\n\r\nlibraryDependencies ++= Seq(\r\n  \"org.scala-js\" %%% \"scalajs-java-time\" % \"0.1.0\"\r\n)\r\n\r\njsDependencies ++= Seq(\r\n\"org.webjars\" % \"jquery\" % \"2.1.4\" / \"dist/jquery.js\",\r\n\"org.webjars\" % \"bootstrap\" % \"3.3.4\" / \"bootstrap.js\" minified \"bootstrap.min.js\" dependsOn \"dist/jquery.js\",\r\n\"org.webjars.bower\" % \"bootstrap-daterangepicker\" % \"2.1.17\" / \"daterangepicker.js\" dependsOn \"bootstrap.js\"\r\n)\r\n```\r\n\r\nHowever what I actually wanted to import was version 2.1.4 of jQuery. It seems the currently used method for disambiguation is not strong enough to resolve this type of name collision.\r\n\r\nThanks for your help!"},"comment":{"url":"https://api.github.com/repos/scala-js/scala-js/issues/comments/190934752","html_url":"https://github.com/scala-js/scala-js/issues/2275#issuecomment-190934752","issue_url":"https://api.github.com/repos/scala-js/scala-js/issues/2275","id":190934752,"user":{"login":"sjrd","id":535934,"avatar_url":"https://avatars.githubusercontent.com/u/535934?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrd","html_url":"https://github.com/sjrd","followers_url":"https://api.github.com/users/sjrd/followers","following_url":"https://api.github.com/users/sjrd/following{/other_user}","gists_url":"https://api.github.com/users/sjrd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrd/subscriptions","organizations_url":"https://api.github.com/users/sjrd/orgs","repos_url":"https://api.github.com/users/sjrd/repos","events_url":"https://api.github.com/users/sjrd/events{/privacy}","received_events_url":"https://api.github.com/users/sjrd/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T22:27:12Z","updated_at":"2016-03-01T22:27:12Z","body":"I think your question would be more appropriate [on StackOverflow](http://stackoverflow.com/questions/tagged/scala.js). There are already [a number of questions about `jsDependencies`](http://stackoverflow.com/search?q=[scala.js]+jsDependencies).\r\n\r\nIn general, we reserve the GitHub issues for actual issues or feature requests."}}