scalajs-env-jsdom-nodejs 运行失败并显示 UnsupportedInputException [英] scalajs-env-jsdom-nodejs run fails with UnsupportedInputException

查看:82
本文介绍了scalajs-env-jsdom-nodejs 运行失败并显示 UnsupportedInputException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试组合一个非常简单的项目.它可以编译,但是当我尝试 run 它时,它失败了:

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))

项目代码位于 https://github.com/esgott/onlyco.我一直在调试这个问题,你有什么线索吗?

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

推荐答案

当使用 scalajs-bundler 时,就像你所做的那样,将 jsEnv 指定为 是不够的JSDOMNodeJSEnv.相反,正如 参考文档所说,您应该使用以下 scalajs- 特定于捆绑程序的设置:

When using scalajs-bundler, as you seem to be doing, it is not enough to specify jsEnv to be a JSDOMNodeJSEnv. Instead, as the reference documentation says, you should use the following scalajs-bundler-specific setting:

requireJsDomEnv in Test := true

这篇关于scalajs-env-jsdom-nodejs 运行失败并显示 UnsupportedInputException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆