Closed sjrd closed 2 years ago
Found it. It is an instance of the upstream issue https://github.com/nodejs/node/issues/40537, which is a consequence of an intended change of behavior https://github.com/nodejs/node/pull/39987. The JVM server for the Com runs on IPv4, but Node.js now tries to connect to it via IPv6.
As a workaround, pass the --dns-result-order=ipv4first
option to the Node.js environment, using
new NodeJSEnv(NodeJSEnv.Config().withArgs(List("--dns-result-order=ipv4first")))
For example, in an sbt build, that would be in a setting like
import org.scalajs.jsenv.nodejs.NodeJSEnv
jsEnv := new NodeJSEnv(NodeJSEnv.Config().withArgs(List("--dns-result-order=ipv4first")))
We have now published scalajs-env-nodejs v1.2.1, which contains a proper fix to this issue. It will be included in Scala.js 1.8.0, but that is not for tomorrow. In the meantime, you may force scalajs-env-nodejs v1.2.1 to be used, even with older Scala.js versions, with the following setting in project/plugins.sbt
:
libraryDependencies += "org.scala-js" %% "scalajs-env-nodejs" % "1.2.1"
It seems that our Com setup for the Node.js env is completely broken on Node.js 17. The symptom in a Scala.js application is
The test suite of this repo indeed fails on Node.js 17.0.1, whereas it passes on 16.13.0:
This issue makes any
test
task in a Scala.js project completely unusable.