My code was working fine. I deleted the target
directory and the code stopped compiling. I suppose it is because play
creates certain files automatically (eg routes
) which it can’t find any longer. How could I make the code compile again.
The errors are
Error:(18, 8) not found: object router
import router.Routes
Error:(415, 25) not found: type Routes
lazy val router = new Routes(httpErrorHandler, homeController,userWSRoutes, questionsWSRoutes, answersWSRoutes,assets)
C:\...\code_related\code\frontend\web\app\controllers\HomeController.scala
Error:(74, 27) object index is not a member of package views.html
Ok(views.html.index(message, messagesApi("app.title")(langs.availables(0)),userCookieOption.get.value,resetPasswordToken.get.value))
Error:(76, 27) object index is not a member of package views.html
Ok(views.html.index(message, messagesApi("app.title")(langs.availables(0)),"",""))
Referring to the documentation, I suppose Play
generated router.Routes
file and it can’t find it now as I deleted the target
directory. I thought that recompiling the code would regenerate it but probably it doesn’t. - https://www.playframework.com/documentation/2.5.x/ScalaCompileTimeDependencyInjection