ScalaJS: Referring to non-existent class play.twirl.api.Html

241 views Asked by At

Tried to upgraded from ScalaJS 0.6.x to 1.3.1. Now I'm stuck with this linking error. It's a play framework cross project where I use twirl templates on client and server side. Here are the configuration files.

I could also reproduce that error with a simple demo: play-scalajs-shared-twirl

project/plugin.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.0")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject"      % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.1")

and build.sbt:

lazy val shared = crossProject(JSPlatform, JVMPlatform)
  .crossType(CrossType.Pure).in(file("shared"))
  .settings(
     commonSettings, 
     name := "shared",
     libraryDependencies ++= Seq(
       "com.lihaoyi" %% "upickle" % "1.2.0"
     )
   )
  .enablePlugins(ScalaJSPlugin).
    jsConfigure(_ enablePlugins JSDependenciesPlugin ) 
      .enablePlugins(SbtTwirl)
      .settings(
         sourceDirectories in (Compile, TwirlKeys.compileTemplates) +=
         (baseDirectory.value.getParentFile / "src" / "main" / "scala"),
         ...
      )

here the error message from compile:

[info] Fast optimizing /Users/robert/Workspace/TournService/client/target/scala-2.13/client-fastopt
[error] Referring to non-existent class play.twirl.api.Html
...
[error] There were linking errors
[error] (client / Compile / fastLinkJS) There were linking errors

The sbt-Verion is 1.3.5 Any help appreciated - Thanks

0

There are 0 answers