user3116355
user3116355

Reputation: 1197

Scala PlayFramework waiting for source changes. But Not responding

I have modified the main.scala.html file in views of my app based on scala. I reverted the changes. But when I am running "~run" to open the play framework it is showing

 Waiting for source changes... (press enter to interrupt)

It is not even responding from that stage. The program is working when I call my inputs from Restapi client postman. But the print statements are not displaying on the terminal of my MacOsx. The program is written on Java. It is a huge program, so I am not able to post it here. Any idea of recovering this?

Is this an error or application bug, as it is taking too much time .

Upvotes: 2

Views: 741

Answers (4)

Nima Mousavi
Nima Mousavi

Reputation: 1661

~run is an sbt specific command and runs a sbt task. ~ Tells sbt to run in continuous mode. sbt is telling you that it is waiting for source changes, which will automatically be compiled.

When I run my application this message usually appears after the code is done. It's a development feature I guess. If you don't need it than don't use the ~ but:

sbt run

Upvotes: 0

Alex Njoroge
Alex Njoroge

Reputation: 1

Try using play run instead of sbt ~run

Upvotes: 0

Isabaellchen
Isabaellchen

Reputation: 98

I tried to fix this using iTerm2 instead of terminal, which worked for some time or maybe i was just more productive during that period. However, there is an issue on github regarding this problem (https://github.com/playframework/playframework/issues/3608). When using activator, the following line gets added to your build.sbt:

fork in run := true

Setting this to false or commenting it out, allowed me at least to have play recompile on page reload and show me my page, after firing it up with sbt run.

There is also a section regarding the live reloading of code on the migration guide for play, because they renamed the playWatchService in 2.5, but i have not tested this out yet.

see: https://www.playframework.com/documentation/2.5.x/Migration24#playWatchService-renamed

Upvotes: 0

artbristol
artbristol

Reputation: 32407

"Waiting for source changes" means your application is up and working. There must be some other problem.

Upvotes: 2

Related Questions