Skip to content

Scala.js: Support running tests in Node 17 #1664

@davesmith00000

Description

@davesmith00000

Node 17 prevented Scala.js versions prior to 1.8.0 from running tests in sbt without a workaround or adding a support library. This was fixed in Scala.js 1.8.0 (presumably in the sbt plugin).

Details of the issue are here: scala-js/scala-js-js-envs#12

Under Mill, using Scala.js 1.8.0 does not resolve the problem, and the following workaround is required:

  object test extends Tests {
    ...
    override def jsEnvConfig = T(JsEnvConfig.NodeJs(args = List("--dns-result-order=ipv4first")))
  }

Otherwise you see an error similar to:

Scala.js Com failed: Error: connect ECONNREFUSED

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions