webjars / webjars-play

MIT License
80 stars 34 forks source link

[Play 2.7.3] Error: "value WebJarAssets is not a member of object controllers.routes" #90

Closed mslinn closed 4 years ago

mslinn commented 4 years ago

I am using Scala 2.12.10, sbt 1.3.2, Play 2.73 on Ubuntu on Windows 10.

Yay! Pictures!

webjarCompilation

webjarCompilation2

Does build.sbt look right?

libraryDependencies ++= Seq(
  cacheApi,
  "com.typesafe.akka" %% "akka-slf4j"   % "2.5.23"  withSources(),
  "javax.inject"      %  "javax.inject" % "1"       withSources(),
  "org.webjars"       %% "webjars-play" % "2.7.3"   withSources(),
  "org.webjars"        % "bootstrap"    % "3.3.7-1" withSources(),
  "net.codingwell"    %% "scala-guice"  % "4.2.6"   withSources(),
  //
  "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3" % Test
)

Might my routes file be the problem?

GET  /webjars/*file  org.webjars.play.WebJarAssets.at(file)

Thanks, Mike

mikeSaxMikeDjembe_500

jamesward commented 4 years ago

Thanks Mike! Looking great. :)

A while back we changed the API to be more injection friendly. Changes shouldn't be too hard to migrate to: https://www.webjars.org/documentation

Let me know if any questions come up. And yeah, we should have a migration doc.

mslinn commented 4 years ago

Migration done: https://github.com/mslinn/play27-template The public domain (CC0) library is a template for Play 2.7 webapps. It includes working examples of WebJars. Please tell the world :)

jamesward commented 4 years ago

Awesome! Thanks Mike.