scalacenter / scalajs-bundler

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

Updating to 0.16 causes `error: not found: value scalaJSModuleKind` #321

Open TobiasRoland opened 4 years ago

TobiasRoland commented 4 years ago

When I try to update from 0.14.0 to 0.16.0, I get the following error:

/mnt/c/Users/Tobias Roland/IdeaProjects/mockingbot/build.sbt:1: error: not found: value scalaJSModuleKind scalaJSModuleKind := ModuleKind.CommonJSModule [error] Type error in expression

build.properties:

sbt.version=1.3.7

plugins.sbt:

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.31")
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.16.0")

build.sbt:

scalaJSModuleKind := ModuleKind.CommonJSModule
scalaJSUseMainModuleInitializer := false
enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
resolvers += Resolver.sonatypeRepo("releases")
scalaVersion := "2.12.10"

libraryDependencies ++= Seq(
  "io.scalajs.npm" %%% "express" % "0.4.2",
  "org.scala-js" %%% "scalajs-java-time" % "0.2.6",
  "org.scalatest" %%% "scalatest" % "3.1.0" % "test",
)

Am I doing something wrong, or is there a known issue?

TobiasRoland commented 4 years ago

Also applies to 0.15

exoego commented 4 years ago

https://github.com/scalacenter/scalajs-bundler/issues/311#issuecomment-564032405 The above issue thread might resolve this issue. The artifact id of scalajs bundler for Scala.js 0.6 has been changed to addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler-sjs06" % "0.16.0").

TobiasRoland commented 4 years ago

Thanks @exoego, that does indeed help. If I want to use the latest & greatest of scala.js, sbt and bundler, is there a good example project or giter8 template I can look at? I was having a bit of pain trying to get the above build.sbt to compile with the latest scala.js 1.x