I ran the Scala 3 compiler successfully with the -scalajs
option, sjsir
files appear in the target directory as expected.
After this step, I wanted to create human-readable JavaScript. Therefore I added scalajs-linker
as a dependency to the SBT project.
Running the first step again with the scalajs-linker
being added, I unexpectedly get an error:
while compiling: (inline)
during phase: genSJSIR
mode: Mode(ImplicitsEnabled)
library version: version 2.13.14
compiler version: version 3.5.0
settings: -classpath "" -d (memory) -nowarn true -scalajs true -usejavacp true
An exception or error caused a run to abort: 'org.scalajs.ir.Types$ClassType org.scalajs.ir.Types$ClassType$.unapply(org.scalajs.ir.Types$ClassType)'
java.lang.NoSuchMethodError: 'org.scalajs.ir.Types$ClassType org.scalajs.ir.Types$ClassType$.unapply(org.scalajs.ir.Types$ClassType)'
...
I assume the source to be compiled was OK, as sjsir
files were generated. I don’t know if this counts or not, but I compiled a simple Hello app. The goal is to be able to compile arbitrary Scala classes to JS, which can be lazy-loaded by the front end.
Do you have any idea what could cause this error? How do you include the linker properly in an SBT project for human-readable JS generation?