使用 b4-bootstrap 旋转 forwardsRouter No Such Method Error

Twirl forwardsRouter No Such Method Error with b4-bootstrap

我正在使用 Play 2.5.12 和 b4-bootstrap。今天我有一个奇怪的问题。我还要求 b4-bootstrap 支持。但也许这里有人遇到了同样的问题。

错误:

java.lang.NoSuchMethodError: play.routes.compiler.inject.twirl.forwardsRouter_Scope0$forwardsRouter._display_(Ljava/lang/Object;Lscala/reflect/Manifest;)Lplay/twirl/api/Appendable;
    at play.routes.compiler.inject.twirl.forwardsRouter_Scope0$forwardsRouter$$anonfun$apply.apply(forwardsRouter.template.scala:27)
    at play.routes.compiler.inject.twirl.forwardsRouter_Scope0$forwardsRouter$$anonfun$apply.apply(forwardsRouter.template.scala:27)
    at scala.Option.map(Option.scala:145)
    at play.routes.compiler.inject.twirl.forwardsRouter_Scope0$forwardsRouter.apply(forwardsRouter.template.scala:27)
    at play.routes.compiler.InjectedRoutesGenerator$.generateRouter(RoutesGenerator.scala:210)
    at play.routes.compiler.InjectedRoutesGenerator$.generate(RoutesGenerator.scala:154)
    at play.routes.compiler.RoutesCompiler$$anonfun$compile.apply(RoutesCompiler.scala:88)
    at play.routes.compiler.RoutesCompiler$$anonfun$compile.apply(RoutesCompiler.scala:87)
    at scala.util.Either$RightProjection.map(Either.scala:536)
    at play.routes.compiler.RoutesCompiler$.compile(RoutesCompiler.scala:87)
    at play.sbt.routes.RoutesCompiler$$anonfun$$anonfun.apply(RoutesCompiler.scala:137)
    at play.sbt.routes.RoutesCompiler$$anonfun$$anonfun.apply(RoutesCompiler.scala:136)
    at scala.collection.TraversableLike$$anonfun$map.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map.apply(TraversableLike.scala:244)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at play.sbt.routes.RoutesCompiler$$anonfun.apply(RoutesCompiler.scala:136)
    at play.sbt.routes.RoutesCompiler$$anonfun.apply(RoutesCompiler.scala:134)
    at com.typesafe.sbt.web.incremental.package$.syncIncremental(package.scala:228)
    at play.sbt.routes.RoutesCompiler$.compileRoutes(RoutesCompiler.scala:134)
    at play.sbt.routes.RoutesCompiler$$anonfun.apply(RoutesCompiler.scala:127)
    at play.sbt.routes.RoutesCompiler$$anonfun.apply(RoutesCompiler.scala:126)
    at scala.Function1$$anonfun$compose.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:228)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:237)
    at sbt.Execute$$anonfun$submit.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit.apply(Execute.scala:228)
    at sbt.ConcurrentRestrictions$$anon$$anonfun.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (web/compile:playRoutes) java.lang.NoSuchMethodError: play.routes.compiler.inject.twirl.forwardsRouter_Scope0$forwardsRouter._display_(Ljava/lang/Object;Lscala/reflect/Manifest;)Lplay/twirl/api/Appendable;

我的最小示例是

@import logic.userComponent.auth.DefaultEnv
@import com.mohiva.play.silhouette.api.actions.UserAwareRequest
@import play.api.Configuration
@import form.SignInForm
@import play.twirl.api.Content
@()(implicit lang:Messages,req: UserAwareRequest[DefaultEnv,_], webJarAssets: WebJarAssets, config: Configuration)

@implicitFieldConstructor = @{ b4.horizontal.fieldConstructor("col-md-4", "col-md-8") }

<html>
    <head></head>
    <body>
        ahllo
        @b4.hidden("hideMe","")
        @* @b4.text(SignInForm.form("email")) *@
    </body>
</html>

我不明白错误。因为上周一切正常。

我找到问题了!!!

对于所有可能 运行 相同的人!这就是解决方案!

我用了 "com.vmunier" %% "scalajs-scripts" % "1.1.0" 但是对于我的旋转我需要 -> "com.vmunier" %% "scalajs-scripts" % "1.0.0"