`activator ~ run` does not work

When activator ~ run starts, this is what happens:

  • When the dev server first starts up, I get a message on the console saying that the server is listening on port 9000.
  • Now, when I make changes to the files and save, nothing is displayed on the console.
  • However, when I refresh the page, I see a reboot message in the console and loading the browser.

I thought ~ run means restarting every time the file changes?

+1
source share
3 answers

Open the build.sbt file and check if it contains a line like fork in run := true . If so, delete the line or set to false .

Why is this?

this plug is required in the Activator user interface to start the processes, so every time you start the application from the user interface, it first adds a line to make sure that it exists. In any case, this causes some problems with a hot restart (as well as some other strange things, such as application hangs, memory leaks).

+6
source

According to Play Docs :

Tip. You can run the application with ~ run to enable direct compilation when changing the file. Thus, scala template files are automatically detected when a new template is created in the view and automatically compiled when the file changes. If you use a regular run, you need to click Refresh on your browser each time.

Therefore, it apparently only applies to Scala template files.

EDIT

Ryan is right, he just tested it, and it also works for Scala files.

Since it does not work at all with spaces between "~" and "run", I believe that this is not a problem either (you quoted it with a space).

+1
source

Did you try to start the console first by typing

 activator 

Then after completing the console, you can enter

 [your-app] $ ~run 

Usually when any files are changed / added. This will cause the compilation process.

0
source

Source: https://habr.com/ru/post/1237138/


All Articles