从 Scala.rx 0.3.2 更新到 0.4.0 时出现链接错误
LinkingErrors when updating from Scala.rx 0.3.2 to 0.4.0
在我的项目中,我使用 Scala.rx 0.3.2。当我升级到 0.4.0 版时 - 没有更改任何代码 - 即使是简单的代码,我也会突然收到很多 LinkingErrors:
private val pageVisibility: Var[String] = Var(document.visibilityState.toString)
private def onPageVisibilityChanged(e: Event): Unit = {
pageVisibility() = document.visibilityState.toString
}
val visible = Rx {
pageVisibility().toString match {
case "visible" => true
case _ => false
}
}
以下是链接错误:
[info] Compiling 1 Scala source to C:\Users\...\target\scala-2.12\classes ...
[info] Done compiling.
[info] Fast optimizing C:\Users\...-fastopt.js
[error] Referring to non-existent class rx.package$GenericOps$
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.render()org.scalajs.dom.raw.Text
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(org.scalajs.dom.raw.Element)scala.Unit
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxNodeInstances$rxStringFrag
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$.GenericOps(rx.Rx)rx.Rx
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.render()org.scalajs.dom.raw.Text
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(org.scalajs.dom.raw.Element)scala.Unit
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxNodeInstances$rxStringFrag
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$GenericOps$.foreach$extension(rx.Rx,scala.Function1,rx.Ctx$Owner)rx.Obs
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.render()org.scalajs.dom.raw.Text
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(org.scalajs.dom.raw.Element)scala.Unit
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxNodeInstances$rxStringFrag
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$GenericOps$.foreach$extension(rx.Rx,scala.Function1,rx.Ctx$Owner)rx.Obs
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Style,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(java.lang.Object,scalatags.generic.Style,java.lang.Object)scala.Unit
[error] called from scalatags.generic.StylePair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxStyleInstances$RxStyleValue
[error] scalatags.generic.StylePair
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$.GenericOps(rx.Rx)rx.Rx
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Style,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(java.lang.Object,scalatags.generic.Style,java.lang.Object)scala.Unit
[error] called from scalatags.generic.StylePair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxStyleInstances$RxStyleValue
[error] scalatags.generic.StylePair
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$GenericOps$.foreach$extension(rx.Rx,scala.Function1,rx.Ctx$Owner)rx.Obs
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Attr,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(java.lang.Object,scalatags.generic.Attr,java.lang.Object)scala.Unit
[error] called from scalatags.generic.AttrPair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxAttrInstances$RxAttrValue
[error] scalatags.generic.AttrPair
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$.GenericOps(rx.Rx)rx.Rx
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Attr,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(java.lang.Object,scalatags.generic.Attr,java.lang.Object)scala.Unit
[error] called from scalatags.generic.AttrPair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxAttrInstances$RxAttrValue
[error] scalatags.generic.AttrPair
[error] scalatags.JsDom$TypedTag
[error] org.scalajs.core.tools.linker.LinkingException: There were linking errors
[error] at org.scalajs.core.tools.linker.frontend.BaseLinker.linkInternal(BaseLinker.scala:160)
[error] at org.scalajs.core.tools.linker.frontend.BaseLinker.linkInternal(BaseLinker.scala:108)
[error] at org.scalajs.core.tools.linker.frontend.LinkerFrontend.$anonfun$link(LinkerFrontend.scala:63)
[error] at org.scalajs.core.tools.logging.Logger.time(Logger.scala:28)
[error] at org.scalajs.core.tools.logging.Logger.time$(Logger.scala:26)
[error] at org.scalajs.sbtplugin.Loggers$SbtLoggerWrapper.time(Loggers.scala:7)
[error] at org.scalajs.core.tools.linker.frontend.LinkerFrontend.link(LinkerFrontend.scala:62)
[error] at org.scalajs.core.tools.linker.Linker.$anonfun$link(Linker.scala:52)
[error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] at org.scalajs.core.tools.linker.Linker.guard(Linker.scala:69)
[error] at org.scalajs.core.tools.linker.Linker.link(Linker.scala:50)
[error] at org.scalajs.core.tools.linker.ClearableLinker.$anonfun$link(ClearableLinker.scala:52)
[error] at org.scalajs.core.tools.linker.ClearableLinker.$anonfun$link$adapted(ClearableLinker.scala:52)
[error] at org.scalajs.core.tools.linker.ClearableLinker.linkerOp(ClearableLinker.scala:63)
[error] at org.scalajs.core.tools.linker.ClearableLinker.link(ClearableLinker.scala:52)
[error] at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSStageSettings(ScalaJSPluginInternal.scala:310)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:73)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:147)
[error] at sbt.util.Difference.apply(Tracked.scala:313)
[error] at sbt.util.Difference.apply(Tracked.scala:293)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:143)
[error] at sbt.util.Difference.apply(Tracked.scala:313)
[error] at sbt.util.Difference.apply(Tracked.scala:288)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:142)
[error] at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSStageSettings(ScalaJSPluginInternal.scala:315)
[error] at sbt.std.Transform$$anon.$anonfun$apply(System.scala:46)
[error] at sbt.std.Transform$$anon.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon.call(CompletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Compile / fastOptJS) org.scalajs.core.tools.linker.LinkingException: There were linking errors
[error] Total time: 7 s, completed 19.12.2018 17:11:27
我知道这是一个非常具体的问题,但如果能提供有关在哪里寻找大量解决方案的提示,我将不胜感激。
编辑:
在 运行 whatDependsOn
之后,我得到以下结果:
[IJ]sbt:yyy-yyyyy> whatDependsOn com.lihaoyi scalarx_sjs0.6_2.12
[info] com.lihaoyi:scalarx_sjs0.6_2.12:0.4.0 [S]
[info] +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-com.timushev:scalatags-rx_sjs0.6_2.12:0.3.0 [S]
[info] | +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | |
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info]
[info] com.lihaoyi:scalarx_sjs0.6_2.12:0.3.2 (evicted by: 0.4.0)
[info] +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-com.timushev:scalatags-rx_sjs0.6_2.12:0.3.0 [S]
[info] | +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | |
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
这个结果告诉我两个问题:
- 在我的代码中,我没有留下一个
libraryDependencies += "com.lihaoyi" %%% "scalarx" % "0.3.2"
,那为什么它仍然被引用?
com.timushev scalatags-rx 0.3.0
也依赖于 Scala.rx 0.3.2,所以显然我不能升级我的?
我会猜测(请注意,只是一个猜测)您的构建中有冲突版本的 Scala.Rx - 存在传递依赖关系拉入更早的版本像 0.3.2 这样的版本。所以他们使用的是 0.3.2 中的 class,它在 0.4.0 中不再存在。
这种版本冲突时有发生;通常,这意味着您需要更新引入传递依赖的库。 sbt-dependency-graph 插件通常有助于检查您实际使用的所有库和版本。
在我的项目中,我使用 Scala.rx 0.3.2。当我升级到 0.4.0 版时 - 没有更改任何代码 - 即使是简单的代码,我也会突然收到很多 LinkingErrors:
private val pageVisibility: Var[String] = Var(document.visibilityState.toString)
private def onPageVisibilityChanged(e: Event): Unit = {
pageVisibility() = document.visibilityState.toString
}
val visible = Rx {
pageVisibility().toString match {
case "visible" => true
case _ => false
}
}
以下是链接错误:
[info] Compiling 1 Scala source to C:\Users\...\target\scala-2.12\classes ...
[info] Done compiling.
[info] Fast optimizing C:\Users\...-fastopt.js
[error] Referring to non-existent class rx.package$GenericOps$
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.render()org.scalajs.dom.raw.Text
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(org.scalajs.dom.raw.Element)scala.Unit
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxNodeInstances$rxStringFrag
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$.GenericOps(rx.Rx)rx.Rx
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.render()org.scalajs.dom.raw.Text
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(org.scalajs.dom.raw.Element)scala.Unit
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxNodeInstances$rxStringFrag
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$GenericOps$.foreach$extension(rx.Rx,scala.Function1,rx.Ctx$Owner)rx.Obs
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.render()org.scalajs.dom.raw.Text
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(org.scalajs.dom.raw.Element)scala.Unit
[error] called from scalatags.rx.RxNodeInstances$rxStringFrag.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxNodeInstances$rxStringFrag
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$GenericOps$.foreach$extension(rx.Rx,scala.Function1,rx.Ctx$Owner)rx.Obs
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Style,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(java.lang.Object,scalatags.generic.Style,java.lang.Object)scala.Unit
[error] called from scalatags.generic.StylePair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxStyleInstances$RxStyleValue
[error] scalatags.generic.StylePair
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$.GenericOps(rx.Rx)rx.Rx
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Style,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxStyleInstances$RxStyleValue.apply(java.lang.Object,scalatags.generic.Style,java.lang.Object)scala.Unit
[error] called from scalatags.generic.StylePair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxStyleInstances$RxStyleValue
[error] scalatags.generic.StylePair
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$GenericOps$.foreach$extension(rx.Rx,scala.Function1,rx.Ctx$Owner)rx.Obs
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Attr,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(java.lang.Object,scalatags.generic.Attr,java.lang.Object)scala.Unit
[error] called from scalatags.generic.AttrPair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxAttrInstances$RxAttrValue
[error] scalatags.generic.AttrPair
[error] scalatags.JsDom$TypedTag
[error] Referring to non-existent method rx.package$.GenericOps(rx.Rx)rx.Rx
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(org.scalajs.dom.raw.Element,scalatags.generic.Attr,rx.Rx)scala.Unit
[error] called from scalatags.rx.RxAttrInstances$RxAttrValue.apply(java.lang.Object,scalatags.generic.Attr,java.lang.Object)scala.Unit
[error] called from scalatags.generic.AttrPair.applyTo(java.lang.Object)scala.Unit
[error] called from scalatags.generic.TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.build(java.lang.Object)scala.Unit
[error] called from scalatags.JsDom$TypedTag.render()org.scalajs.dom.raw.Element
[error] called from scalatags.JsDom$TypedTag.toString()java.lang.String
[error] called from com.xxxx.cc.b.core.base.xxxBase$.<init>()
[error] called from com.xxxx.cc.b.xxxxx.xxxxxViewPage$.<init>()
[error] called from com.xxxx.cc.b.navbar.xxxxxOptionsDropDown.<init>()
[error] called from com.xxxx.cc.b.navbar.NavBar$.<init>()
[error] called from com.xxxx.cc.b.base.xxx$.<init>()
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] scalatags.rx.RxAttrInstances$RxAttrValue
[error] scalatags.generic.AttrPair
[error] scalatags.JsDom$TypedTag
[error] org.scalajs.core.tools.linker.LinkingException: There were linking errors
[error] at org.scalajs.core.tools.linker.frontend.BaseLinker.linkInternal(BaseLinker.scala:160)
[error] at org.scalajs.core.tools.linker.frontend.BaseLinker.linkInternal(BaseLinker.scala:108)
[error] at org.scalajs.core.tools.linker.frontend.LinkerFrontend.$anonfun$link(LinkerFrontend.scala:63)
[error] at org.scalajs.core.tools.logging.Logger.time(Logger.scala:28)
[error] at org.scalajs.core.tools.logging.Logger.time$(Logger.scala:26)
[error] at org.scalajs.sbtplugin.Loggers$SbtLoggerWrapper.time(Loggers.scala:7)
[error] at org.scalajs.core.tools.linker.frontend.LinkerFrontend.link(LinkerFrontend.scala:62)
[error] at org.scalajs.core.tools.linker.Linker.$anonfun$link(Linker.scala:52)
[error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] at org.scalajs.core.tools.linker.Linker.guard(Linker.scala:69)
[error] at org.scalajs.core.tools.linker.Linker.link(Linker.scala:50)
[error] at org.scalajs.core.tools.linker.ClearableLinker.$anonfun$link(ClearableLinker.scala:52)
[error] at org.scalajs.core.tools.linker.ClearableLinker.$anonfun$link$adapted(ClearableLinker.scala:52)
[error] at org.scalajs.core.tools.linker.ClearableLinker.linkerOp(ClearableLinker.scala:63)
[error] at org.scalajs.core.tools.linker.ClearableLinker.link(ClearableLinker.scala:52)
[error] at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSStageSettings(ScalaJSPluginInternal.scala:310)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:73)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:147)
[error] at sbt.util.Difference.apply(Tracked.scala:313)
[error] at sbt.util.Difference.apply(Tracked.scala:293)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:143)
[error] at sbt.util.Difference.apply(Tracked.scala:313)
[error] at sbt.util.Difference.apply(Tracked.scala:288)
[error] at sbt.util.FileFunction$.$anonfun$cached(FileFunction.scala:142)
[error] at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSStageSettings(ScalaJSPluginInternal.scala:315)
[error] at sbt.std.Transform$$anon.$anonfun$apply(System.scala:46)
[error] at sbt.std.Transform$$anon.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon.call(CompletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Compile / fastOptJS) org.scalajs.core.tools.linker.LinkingException: There were linking errors
[error] Total time: 7 s, completed 19.12.2018 17:11:27
我知道这是一个非常具体的问题,但如果能提供有关在哪里寻找大量解决方案的提示,我将不胜感激。
编辑:
在 运行 whatDependsOn
之后,我得到以下结果:
[IJ]sbt:yyy-yyyyy> whatDependsOn com.lihaoyi scalarx_sjs0.6_2.12
[info] com.lihaoyi:scalarx_sjs0.6_2.12:0.4.0 [S]
[info] +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-com.timushev:scalatags-rx_sjs0.6_2.12:0.3.0 [S]
[info] | +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | |
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info]
[info] com.lihaoyi:scalarx_sjs0.6_2.12:0.3.2 (evicted by: 0.4.0)
[info] +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-com.timushev:scalatags-rx_sjs0.6_2.12:0.3.0 [S]
[info] | +-com-xxxx-xx-x-core:com-xxxx-xx-x-core_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] | |
[info] | +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
[info] |
[info] +-yyy-yyyyy:yyy-yyyyy_sjs0.6_2.12:0.1.0-SNAPSHOT [S]
这个结果告诉我两个问题:
- 在我的代码中,我没有留下一个
libraryDependencies += "com.lihaoyi" %%% "scalarx" % "0.3.2"
,那为什么它仍然被引用? com.timushev scalatags-rx 0.3.0
也依赖于 Scala.rx 0.3.2,所以显然我不能升级我的?
我会猜测(请注意,只是一个猜测)您的构建中有冲突版本的 Scala.Rx - 存在传递依赖关系拉入更早的版本像 0.3.2 这样的版本。所以他们使用的是 0.3.2 中的 class,它在 0.4.0 中不再存在。
这种版本冲突时有发生;通常,这意味着您需要更新引入传递依赖的库。 sbt-dependency-graph 插件通常有助于检查您实际使用的所有库和版本。