Strange difference between fastLinkJS and fullLinkJS in ScalaJS since version 1.11

A webclient which makes use of AkkaJS (via crossVersion.for3Use2_13) written in Scala 3.2 compiled with ScalaJS worked just fine up to version 1.10.1. Now, both with the versions 1.11.0 and 1.12.0 i get an execution error in the Akka library:

[Error] Error
	$p_Lakka_actor_ActorCell__invokeAll$1__Lakka_dispatch_sysmsg_SystemMessage__I__V  ActorCell.scala:532 (main.js:171670:116)
	(anonymous function) ActorCell.scala:535  (main.js:82000:86)
	(anonymous function) Mailbox.scala:242 (main.js:81983)
	(anonymous function) ExecutorServiceDelegate.scala:17 (main.js:81722)

However, this error does only occur when the application is linked with fastLinkJS. With fullLinkJS everything is fine in the versions 1.11.0 and 1.12.0 as it was before.

Now i don’t expect you guys to solve this for me, but my questions are:

  • has anybody experienced similar differences between fastLinkJS and fullLinkJS since ScalaJS version 1.10?
  • who makes use of AkkaJS as well and has any idea where to start investigations?
  • and are there developers who have enough knowledge of the internals of Akka to have any idea what might be going on here?

Akka.js is compiled against Scala 2.13.2 and Scala.js 1.0.1 which are pretty old.
You can try to clone akka.js, update these versions and publish the lib locally to see if it makes any difference to your app. If it does you can propose the change upstream.

1 Like

IIRC on fastLinkJS the linker adds some checks that explicitly throw runtime errors to replicate JVM behavior, and on fullLinkJS those checks are removed and turned into “undefined behavior”. And I guess undefined behavior can also include “just keeps working”.

I could also be wrong, cause I haven’t used scala.js in a long time.

1 Like