我的多平台构建失败并出现错误,这表明 JVM 和 JS 依赖项都在类路径中。怎么会这样?
[error] |Toplevel definition EnableReflectiveInstantiation is defined in
[error] | /home/runner/.cache/coursier/v1/https/repo1.maven.org/maven2/org/portable-scala/portable-scala-reflect_sjs1_2.13/1.1.2/portable-scala-reflect_sjs1_2.13-1.1.2.jar(org/portablescala/reflect/annotation/package.class)
[error] |and also in
[error] | /home/runner/.cache/coursier/v1/https/repo1.maven.org/maven2/org/portable-scala/portable-scala-reflect_2.13/1.1.2/portable-scala-reflect_2.13-1.1.2.jar(org/portablescala/reflect/annotation/EnableReflectiveInstantiation.class)
[error] |One of these files should be removed from the classpath.
如果 sbt 中的一个或多个依赖项使用非平台感知运算符
%%
而不是平台感知 %%%
,就会发生此类错误。因此,将 JVM 依赖项添加到您的 JS 构建中