0

It appears like @js.native is not identified by my compiler. In general scalajs compiles to me in the project.

link to file (and its including project in github where it fails).

source of the file that fails on @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 {

}

yields:

Funnel.scala:8: type native is not a member of package scala.scalajs.js [error] @js.native [error] ^ [error] one error found

sbt for reference:

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)
Jas
  • 14,493
  • 27
  • 97
  • 148

1 Answers1

1

Looks like you are running scala.js 0.6.1. Try to upgrade your version to >= 0.6.5

aogan
  • 2,241
  • 1
  • 15
  • 24