Search code examples
scala.jsjsdom

Scala.js 1.0.0-RC2 tests failing around jsdom


I'm the process of cross-building UnivEq for Scala.JS 1.0.0-RC2. I've got jsdom installed in Travis and tests pass on the 0.6.31 builds, but fail on the 1.0.0-RC2 builds with TypeError: jsdom.createVirtualConsole is not a function.

Full error log: https://travis-ci.org/japgolly/univeq/jobs/636731705#L312

How to fix? Please help.


Solution

  • This happens because we never ported the additional support of jsdom v12 and later from the Scala.js 0.6.x branch (in this commit) to the newer, separate codebase for JSDOMNodeJSEnv at https://github.com/scala-js/scala-js-env-jsdom-nodejs. Apparently we forgot about that.

    I have created a pull request at https://github.com/scala-js/scala-js-env-jsdom-nodejs/pull/33 to fix the issue.

    Edit: the fix is now published as version 1.0.0-RC3. You can modify your project/plugins.sbt to depend on "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.0.0-RC3" instead of ... % scalaJSVersion. It is compatible with Scala.js 1.0.0-RC2.


    Obsolete old answer:

    You could try using that new version today by checking out the master branch and publishing it locally:

    $ git clone https://github.com/scala-js/scala-js-env-jsdom-nodejs.git
    $ cd scala-js-env-jsdom-nodejs
    $ sbt scalajs-env-jsdom-nodejs/publishLocal
    $ cd ..
    

    then using version 1.0.0-SNAPSHOT instead of 1.0.0-RC2 for scalajs-env-jsdom in your project/plugins.sbt