0
看起来像@js.native
未被我的编译器识别。一般scalajs
在项目中编译给我。@ js.native上的编译错误将@ js.native注释添加到scalajs上的特征时
link to file(及其在github中包含的项目失败)。
Funnel.scala:8:上
@js.native
package example import scala.scalajs.js import js.annotation._ @js.native // sbt won't compile this native not found how to fix? trait Funnel { }
收率失败的文件的
源型天然不是包的成员 scala.scalajs.js [错误] @ js.native [错误]^[错误]一个错误 发现
SBT供参考:
import com.lihaoyi.workbench.Plugin._
enablePlugins(ScalaJSPlugin)
workbenchSettings
name := "Example"
version := "0.1-SNAPSHOT"
scalaVersion := "2.11.5"
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.8.0",
"com.lihaoyi" %%% "scalatags" % "0.5.4"
)
jsDependencies += "org.webjars" % "d3js" % "3.5.12"/"d3.js"
jsDependencies += ProvidedJS/"d3-funnel.js"
bootSnippet := "example.ScalaJSExample().main(document.getElementById('canvas'));"
updateBrowsers <<= updateBrowsers.triggeredBy(fastOptJS in Compile)