Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compile error triggers multiple compilations #7753

@kyleu

Description

@kyleu

Normally, when I screw up my code and "run" my app, refreshing the web browser causes play to compile, fail, and return a "Compilation failed" page. Since upgrading to 2.6, refreshing the browser will cause the code to enter a (compile, fail, repeat) loop. It attempts to compile four times before finally returning to the browser after the last failure. I thought it was Chrome being clever and re-requesting the page, but I've reproduced it with curl as well.

Play Version

2.6.X (tested with 2.6.3)

API

Scala (maybe both)

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

MacOS Sierra

Expected Behavior

  1. Introduce compile error in project.
  2. Start the app with run.
  3. Refresh the browser or curl url.
  4. Play will attempt to compile once, fail, and return a "Compilation failed" page

Actual Behavior

  1. Introduce compile error in project.
  2. Start the app with run.
  3. Refresh the browser or curl url.
  4. Play will attempt to compile four times, before returning a "Compilation failed" page

Reproducible Test Case

  1. sbt new playframework/play-scala-seed.g8
  2. Introduce compile error in project (add a few random characters to the controller).
  3. Start the app with run.
  4. Refresh the browser or curl url.
  5. Play will attempt to compile four times.
[info] Compiling 1 Scala source to /Users/kyle/Temp/xxx/target/scala-2.12/classes...
[error] /Users/kyle/Temp/xxx/app/controllers/HomeController.scala:22: value xxx is not a member of play.api.mvc.Result
[error]     Ok(views.html.index())xxx
[error]                           ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[info] Compiling 1 Scala source to /Users/kyle/Temp/xxx/target/scala-2.12/classes...
[error] /Users/kyle/Temp/xxx/app/controllers/HomeController.scala:22: value xxx is not a member of play.api.mvc.Result
[error]     Ok(views.html.index())xxx
[error]                           ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] application -

! @7559l0cdj - Internal server error, for (GET) [/] ->

play.sbt.PlayExceptions$CompilationException: Compilation error[value xxx is not a member of play.api.mvc.Result]
	at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27)
	at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27)
	at scala.Option.map(Option.scala:145)
	at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:49)
	at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
	at scala.Option.map(Option.scala:145)
	at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:44)
	at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:40)
	at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
	at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
[info] Compiling 1 Scala source to /Users/kyle/Temp/xxx/target/scala-2.12/classes...
[error] /Users/kyle/Temp/xxx/app/controllers/HomeController.scala:22: value xxx is not a member of play.api.mvc.Result
[error]     Ok(views.html.index())xxx
[error]                           ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[info] Compiling 1 Scala source to /Users/kyle/Temp/xxx/target/scala-2.12/classes...
[error] /Users/kyle/Temp/xxx/app/controllers/HomeController.scala:22: value xxx is not a member of play.api.mvc.Result
[error]     Ok(views.html.index())xxx
[error]                           ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions