scalacenter / scalajs-bundler

https://scalacenter.github.io/scalajs-bundler
Other
237 stars 101 forks source link

References to undefined settings when using scala.js v1.3 #373

Closed thebridsk closed 4 years ago

thebridsk commented 4 years ago

Getting the following error when using scala.js v1.3 with scala-bundler v0.18 or v0.19:

[info] loading settings for project akkahttpexample from build.sbt ...
References to undefined settings: 
[error]   client / Compile / fullOptJS / scalaJSLinkerBox from client / Compile / fullOptJS / scalaJSLinker ((scalajsbundler.sbtplugin.Settings.scalaJSStageSettings) Settings.scala:69)
[error]
[error]   client / Test / fastOptJS / scalaJSLinkerBox from client / Test / fastOptJS / scalaJSLinker ((scalajsbundler.sbtplugin.Settings.scalaJSStageSettings) Settings.scala:69)
[error]
[error]   client / Test / fullOptJS / scalaJSLinkerBox from client / Test / fullOptJS / scalaJSLinker ((scalajsbundler.sbtplugin.Settings.scalaJSStageSettings) Settings.scala:69)
[error]
[error]   client / Compile / fastOptJS / scalaJSLinkerBox from client / Compile / fastOptJS / scalaJSLinker ((scalajsbundler.sbtplugin.Settings.scalaJSStageSettings) Settings.scala:69)
[error]
[error] Use 'last' for the full log.

plugins.sbt:

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")

addSbtPlugin("ch.epfl.scala" % "sbt-web-scalajs-bundler" % "0.19.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.19.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.2")

build.sbt:

lazy val akkaHttpVersion = "10.2.1"
lazy val akkaVersion    = "2.6.10"

organization    := "com.example.akkahttp"
scalaVersion    := "2.13.3"

lazy val server = (project in file("server"))
  .enablePlugins(WebScalaJSBundlerPlugin)
  .settings(
    name := "server",
    libraryDependencies ++= Seq(
      "com.typesafe.akka" %% "akka-http"                % akkaHttpVersion withSources(),
      "com.typesafe.akka" %% "akka-http-spray-json"     % akkaHttpVersion withSources(),
      "com.typesafe.akka" %% "akka-actor-typed"         % akkaVersion withSources(),
      "com.typesafe.akka" %% "akka-stream"              % akkaVersion withSources(),

      "com.typesafe.akka" %% "akka-http-testkit"        % akkaHttpVersion % Test withSources(),
      "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion     % Test withSources(),
      "org.scalatest"     %% "scalatest"                % "3.0.8"         % Test withSources(),

      "org.slf4j" % "slf4j-jdk14" % "1.7.30" withSources(),
    ),
    scalaJSProjects := Seq(client),
    // pipelineStages in Assets := Seq(scalaJSPipeline)
    pipelineStages in Assets :=  Seq(scalaJSPipeline, gzip),
    pipelineStages in Test in Assets :=  Seq(scalaJSPipeline, gzip),
  )

lazy val client = (project in file("client"))
    .enablePlugins(ScalaJSPlugin)
    .enablePlugins(ScalaJSBundlerPlugin)
    .settings(
      name := "client",

      scalaJSUseMainModuleInitializer := true,

    )
sjrd commented 4 years ago

Yes, scalajs-bundler doesn't with yet with Scala.js 1.3. I am working on it.

thebridsk commented 4 years ago

@sjrd thanks for your hard work. The 0.20 version is working with Scala.js 1.3

kubukoz commented 3 years ago

Damn, this took me way too long to search for :D apparently the "getting started" guide is stuck on 0.18.