Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScalaJS plugin 0.6.23: "value %%% is not a member of String"

Tags:

sbt

scala.js

After migrating to ScalaJS 0.6.23 from 0.6.21:

(addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23"))

My sbt-build throws the following exception:

...
[error] /Users/mpa/dev/Github/pme123/scala-adapters/project/Settings.scala:88:20: value %%% is not a member of String
[error]     "org.scala-js" %%% "scalajs-dom" % "0.9.6"
[error]                    ^
[error] /Users/mpa/dev/Github/pme123/scala-adapters/project/Settings.scala:90:27: value %%% is not a member of String
[error]     , "com.typesafe.play" %%% "play-json" % "2.6.1"
...

This is the value from the Settings.scala:

  lazy val clientDependencies: Seq[Def.Setting[_]] = Def.settings(libraryDependencies ++= Seq(
    "org.scala-js" %%% "scalajs-dom" % "0.9.6"
    , "org.scala-lang.modules" %% "scala-xml" % "1.0.6"
    , ...
  ))

And this is how it is used in build.sbt:

lazy val client = (project in file("client"))
  .settings(sharedSettings(Some("client")))
  .settings(clientSettings)
  .settings(clientDependencies)
  .settings(jsSettings)
  .enablePlugins(ScalaJSWeb)
  .dependsOn(sharedJs)

This is the project: https://github.com/pme123/scala-adapters

like image 313
pme Avatar asked Jun 09 '18 11:06

pme


1 Answers

The release notes of Scala.js 0.6.23 say that

Usages of %%% in .scala files of an sbt build (under project/) need a new import:

import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

For .sbt files, this import is automatically added, so nothing changes.

So you need to add

import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

in your Settings.scala file.

like image 163
sjrd Avatar answered Oct 23 '22 08:10

sjrd