Open
Description
While working on #634, I noticed that the sbt plug-in fails to detect CommonJS modules. I could trace it down to this function in SbtBloop.scala
:
lazy val findOutScalaJsModuleKind: Def.Initialize[Option[String]] = Def.settingDyn {
try {
val stageClass = Class.forName("core.tools.linker.backend.ModuleKind")
val stageSetting = proxyForSetting("scalaJSModuleKind", stageClass)
Def.setting {
stageSetting.value.toString match {
case "Some(NoModule)" => Some(NoJSModule)
case "Some(CommonJSModule)" => Some(CommonJSModule)
case _ => None
}
}
} catch {
case _: ClassNotFoundException => Def.setting(None)
}
}
A ClassNotFoundException
gets triggered. When I changed stageClass
to classOf[AnyRef]
, stageSetting.value
would always be None
.