Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Vincent Munier
    Nice, good news!
    Ali Akhtar
    Hey, I'm trying to follow along the instructions, but I can't get the continuous compile to work. I ran the project using both ~run and ~reStart but if I change the SharedMessages.itWorks content, and refresh the page, it doesn't show the update message unless I ctrl + c and re-run it.
    Ali Akhtar
    Using ~reStart causes it to get stuck on "Stopping application server (by killing the forked JVM) ..."
    Vincent Munier
    Hey, I've just tried ~reStart on akka-http-scalajs and it's working for me. I am using SBT v1.1.2, what version of SBT are you using?
    Ali Akhtar
    Also using 1.1.2 . I think I previously ran just the sbt run and sbt ~run , could these have caused a forked process to get stuck somehow?
    i've noticed that an old version is still running on localhost:8000 and i had to increment the port to 8001 to get it to bind the port
    Does it auto reload / recompile for you if you make changes and use ~reStart ?
    Vincent Munier
    When using ~reStart and changing SharedMessages.scala, I can see in the SBT output that it's calling fastoptjs (Fast optimizing ...). However, I don't see the Scala.js message being updated in Chrome when I reload the page. I do see the change when I open a private window, so it's probably a caching issue.
    Ryuhei Ishibashi
    Hi, I have a problem that tests doesn’t work in the client project.
    Could you please help me ?
    Vincent Munier

    Hi, it looks like you need to use triple %, so that scalatest and scalacheck can be used from Scala.js. You will also need to use Scala.js 0.6.x instead of Scala.js 1.x because scalatest & scalacheck are not compatible with Scala.js 1.x yet. So, update your build.sbt to have:

    "org.scalatest"  %%% "scalatest"  % "3.0.5"  % Test,
    "org.scalacheck" %%% "scalacheck" % "1.14.0" % Test

    and update your project/plugins.sbt to use:

    addSbtPlugin("com.vmunier"  % "sbt-web-scalajs" % "1.0.8-0.6")
    addSbtPlugin("org.scala-js" % "sbt-scalajs"     % "0.6.23")

    You should then be able to run your client's tests.

    Ryuhei Ishibashi
    Thanks to that, I could fix it. Thank you very much!
    Vincent Munier
    No worries, glad it works
    Joan Goyeau
    Hey how do we use that with https://github.com/scalacenter/scalajs-bundler ?
    I think I need it to run the command fastOptJS/webpack
    Can not reload run with "~run"??
    Error: 8080 Address already in use
    @michael_zh_twitter it looks like you already have a process listening on port 8080
    Jason Pickens
    How can I change the target directory for the scalaJSPipeline mappings? I’d like it to go to a js directory.
    The best I can come up with is to create a new stage that moves the files.
    Vincent Munier
    sbt-web-scalajs does not have any settings to configure the target directory. It relies on sbt-web, which takes care of copying the pipeline output files. If using Play, I think sbt-web's target directory can be changed by setting WebKeys.public in Assets := file("<folder-path>") in the server project
    Timo Meijer

    I'm trying to build a ScalaJS project with Scala 3. If I run my project with scala 2.13 it works fine, but if I change the version to 3.0.0-M3 it fails with bad option: -P:scalajs:mapSourceURI:...
    The issue persists even with the bare minimum configuration:

    lazy val client = (project in file("client"))
        scalaVersion := "3.0.0-M3",
        scalaJSUseMainModuleInitializer := true
      .enablePlugins(ScalaJSPlugin, ScalaJSWeb)

    and plugins:

    addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.1")
    addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.1")
    addSbtPlugin("com.vmunier"  % "sbt-web-scalajs" % "1.1.0")

    Any clue how to resolve this issue?

    Sébastien Doeraene
    In Scala 3 the correct option is -scalajs-mapSourceURI:...
    Timo Meijer
    Ah, so this is something that needs to be changed in the sbt-web-scalajs plugin, so it can be compatible with Scala 3
    Domantas Petrauskas
    Hi, I have ScalaTest setup where I start application and run tests with Selenium, I wonder how I could make assets build and be available in classpath when running tests?
    2 replies
    Vincent Munier
    Hey everyone, sbt-web-scalajs v1.2.0 is now available! It's compatible with Scala 3 and updated to Scala.js 1.5.1 https://github.com/vmunier/sbt-web-scalajs/releases/tag/v1.2.0
    Ryan Richt
    @tzbob or @ngbinh you both historically had this ... IntelliJ recompiles the whole project in order to do an sbt import problem ... (I've memorialized it here: vmunier/sbt-web-scalajs#169) ... did you ever find a solution?