scala-js / scala-js-env-jsdom-nodejs

Node.js with jsdom environment for Scala.js
BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Run fails with UnsupportedInputException #49

Closed esgott closed 4 years ago

esgott commented 4 years ago

I'm trying to put together a very simple project. It compiles, but when I try to run it, it fails with:

[error] org.scalajs.jsenv.UnsupportedInputException: Unsupported input: List(CommonJSModule(/home/esgott/Repos/onlyco/target/scala-2.12/scalajs-bundler/main/onlyco-fastopt.js))
[error]         at org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv.$anonfun$validateInput$1(JSDOMNodeJSEnv.scala:59)
[error]         at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
[error]         at scala.collection.immutable.List.foreach(List.scala:392)
[error]         at scala.collection.TraversableLike.map(TraversableLike.scala:238)
[error]         at scala.collection.TraversableLike.map$(TraversableLike.scala:231)
[error]         at scala.collection.immutable.List.map(List.scala:298)
[error]         at org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv.validateInput(JSDOMNodeJSEnv.scala:54)
[error]         at org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv.start(JSDOMNodeJSEnv.scala:35)
[error]         at org.scalajs.sbtplugin.Run$.runInterruptible(Run.scala:44)
[error]         at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSConfigSettings$49(ScalaJSPluginInternal.scala:438)
[error]         at org.scalajs.sbtplugin.ScalaJSPluginInternal$.$anonfun$scalaJSConfigSettings$49$adapted(ScalaJSPluginInternal.scala:422)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] stack trace is suppressed; run last Compile / run for the full output
[error] (Compile / run) org.scalajs.jsenv.UnsupportedInputException: Unsupported input: List(CommonJSModule(/home/esgott/Repos/onlyco/target/scala-2.12/scalajs-bundler/main/onlyco-fastopt.js))

The project code is at https://github.com/esgott/onlyco. I am stuck at debugging this issue, do you have a clue?

sjrd commented 4 years ago

Hello,

This looks like a question on using Scala.js, rather than a bug report. The GitHub Issues in this repo are for bug reports and feature requests only. Please ask questions on StackOverflow or on Gitter, where more than just the core developers can see and answer.

Thank you for your understanding.

esgott commented 4 years ago

The project seems to require an Input.Script instead of Input.CommonJSModule, which it gets from the bundler. To me it seemed likely that this is a bug. Anyway, I posted it on StackOverflow. https://stackoverflow.com/questions/63958419/scalajs-env-jsdom-nodejs-run-fails-with-unsupportedinputexception