Implementing Hello World example throws compiler error for Scala users

I have just downloaded the Play Scala Starter Example ZIP for Linux. I have followed all steps and created the three required files (and edits) per the following instructions:
https://www.playframework.com/documentation/2.6.x/ImplementingHelloWorld

Upon execution the compiler throws this error:

not enough arguments for method apply: (title: String, assetsFinder: controllers.AssetsFinder)(content: play.twirl.api.Html)play.twirl.api.HtmlFormat.Appendable in object main. Unspecified value parameter assetsFinder.

The browser highlights this line in red as the offender:
@main(“Hello”) {

I am 100% new to this platform, but it seems that main has one argument and the apply method is expecting two arguments. So on a whim I changed the example code to:
@main(“Hello”, null) {… and it “worked”.

Is the example wrong? Do I have a dependency issue?

Hi.

Apparently, the tutorial was not modified after this change here: https://github.com/playframework/play-scala-starter-example/commit/dc2b3feaae073211d635899cb958ad7fabc3ca42

Change your hello.scala.html to look like this:

@()(implicit assetsFinder: AssetsFinder)                                                                                                     

@main("Hello", assetsFinder) {                                                                                                               
    <section id="top">                                                                                                                       
        <div class="wrapper">                                                                                                                
            <h1>Hello World</h1>                                                                                                             
        </div>                                                                                                                               
    </section>                                                                                                                               
}

This makes the assetsFinder from inside the HomeController available to the Twirl template and passes it to the main template as the second parameter.

The problem with the tutorial is that (due to the change above) the Java and Scala starter projects now have diverged as the Java one still uses the old approach and the Scala one uses an AssetsFinder but the tutorial tries to talk about both at the same time.

Thank you Claudio,

I did try your suggestion, but after a compile request it throws a similar error:

no arguments allowed for nullary method apply: ()(implicit assetsFinder: controllers.AssetsFinder)play.twirl.api.HtmlFormat.Appendable in object hello

Other steps in the tutorial cause various errors for the Scala version. The instructions in Step 2 request the H1 tag to use a @name variable. I could not distinguish what was instructional error versus my own and stopped with that example.

I have moved past Hello World since it is problematic for me. The other examples, like ScalaComet, work fine and offer me a learning opportunity. Thanks again for the effort.

Oh, yes. I did just fix the code until step 3.

In step 4 the parameters of the hello template are changed, adding the name. With the assetsFinder in place, it should look like this:

@(name: String)(implicit assetsFinder: AssetsFinder)                                                                                                     

@main("Hello", assetsFinder) {                                                                                                               
    <section id="top">                                                                                                                       
        <div class="wrapper">                                                                                                                
            <h1>Hello @name</h1>                                                                                                             
        </div>                                                                                                                               
    </section>                                                                                                                               
}