Previously I had:
package japgolly.webapp.client.ww
import scalajs.js.annotation._
@JSExport("Main")
object Main {
@JSExport
def main(): Unit = // ...
and in SBT
scalaJSOutputWrapper := ("", "Main().main();"))
All good.
Now trying to use 0.6.15 with scalaJSModuleKind := NoModule, I can't seem to get it call my main method on initialisation.
The gist of what I've been trying is:
scalaJSUseMainModuleInitializer := true,
mainClass := Some("japgolly.webapp.client.ww.Main")
and
scalaJSUseMainModuleInitializer := true,
scalaJSMainModuleInitializer := Some(
org.scalajs.core.tools.linker.ModuleInitializer.mainMethod(
"shipreq.webapp.client.ww.Main", "main"))
with and without annotations in Main.scala but I can't seem to get it to work.
I keep getting this error:
[error] No main module initializer was specified (possibly because no or multiple main classes were found), but scalaJSUseMainModuleInitializer was set to true. You can explicitly specify it either with `mainClass := Some(...)` or with `scalaJSMainModuleInitializer := Some(...)`
[error] (webapp-client-ww/compile:scalaJSModuleInitializers) No main module initializer was specified (possibly because no or multiple main classes were found), but scalaJSUseMainModuleInitializer was set to true. You can explicitly specify it either with `mainClass := Some(...)` or with `scalaJSMainModuleInitializer := Some(...)`
mainClass in Compile
Ah indeed. Thanks.
Suggestion: It might be better to adjust the error message for this. Currently it says:
You can explicitly specify it either with `mainClass := Some(...)`
Most helpful comment
Suggestion: It might be better to adjust the error message for this. Currently it says: