2016-02-19 17 views
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) 

回答

1

看起来您正在运行scala.js 0.6.1。尝试将您的版本升级到> = 0.6.5