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)