2016-09-20 44 views
1

當我試圖鏈接到一個Scala項目中的FastParse時,我收到了一堆鏈接器錯誤,我試圖構建一個ScalaJS Web應用程序。ScalaJS中的鏈接器錯誤:「引用不存在的類」

我添加了FastParse的ScalaJS依賴到我build.sbt:這裏是約相關行(完整的文件here):

libraryDependencies ++= Seq(
    "com.lihaoyi" %%% "fastparse" % "0.4.1" 
) 

我的錯誤是汗牛充棟,但這裏有一個代表性的一個:

[error] Referring to non-existent class fastparse.Implicits$Repeater$ 
[error] called from parsers.MainParser$$anonfun$impls$1.apply()fastparse.core.Parser 
[error] called from parsers.MainParser$$anonfun$impls$1.apply()java.lang.Object 
[error] called from scala.Option.getOrElse(scala.Function0)java.lang.Object 
[error] called from fastparse.StringReprOps$.errorMessage(fastparse.utils.ParserInput,java.lang.String,scala.Int)java.lang.String 
[error] called from fastparse.core.ParseError.<init>(fastparse.core.Parsed$Failure) 
[error] called from fastparse.Api.<init>(scala.reflect.ClassTag,fastparse.utils.ElemSetHelper,fastparse.utils.ReprOps,scala.math.Ordering) 
[error] called from fastparse.StringApi.<init>() 
[error] called from fastparse.all$.<init>() 
[error] called from parsers.MainParser$.<init>() 
[error] called from webapp.WebApp$.makeChoices(java.lang.String,java.lang.String)scala.collection.immutable.List 
[error] called from webapp.WebApp$.$$js$exported$meth$makeChoices(java.lang.String,java.lang.String)java.lang.Object 
[error] called from webapp.WebApp$.makeChoices 
[error] exported to JavaScript with @JSExport 
[error] involving instantiated classes: 
[error] parsers.MainParser$$anonfun$impls$1 
[error] scala.None$ 
[error] scala.Some 
[error] fastparse.StringReprOps$ 
[error] webapp.WebApp$ 

我在做什麼錯?

回答

1

問題是我需要在我的build.sbt兩行中的JVM版本的FastParse。這顯然打破了我的構建。我刪除了該行並清理了我的構建,現在ScalaJS和ScalaJVM版本的項目構建得很好。

(感謝李浩逸爲我發現問題)

相關問題