title: Scala JavaScript Routing Play Framework
body: <p>I'm using Play framework with Scala. I'm facing a weird error and can't figure out what's the solution. The error message is:</p>
  
  <blockquote>
    <p>value Track is not a member of object controllers.routes.javascript</p>
  </blockquote>
  
  <pre><code>&lt;script type="text/javascript" src="@routes.TrackController.javascriptRoutes"&gt;&lt;/script&gt;
  
    @helper.javascriptRouter("jsRoutes")(
      routes.javascript.Track
    )
  
  def Track(id:Long)= Action {implicit request =&gt;
      Ok(views.html.track(
          new TrackData(TrackClient.getTrack(id))))
  
  
    }
  
   def javascriptRoutes = Action { implicit request =&gt;
  
   Ok(
           Routes.javascriptRouter("jsRoutes")    (routes.javascript.TrackController.Track)).as("text/javascript")
      }
  #JavaScriptRouting
  GET     /track/:id                  @controllers.TrackController.Track(id: Long)
  GET     /javascriptRoutes           @controllers.TrackController.javascriptRoutes
  </code></pre>
  
  <p>The new error is : </p>
  
  <pre><code>1@(message: String)
  
  2
  
  3@main("Welcome to Play 2.1") { 
  
  4    
  
  5    @play20.welcome(message)
  
  6    
  
  7}
  </code></pre>
  
  <blockquote>
    <p>index.scala.html at line 3.  Cannot find any HTTP Request Header here</p>
  </blockquote>
  
  <p>It says index.scala but I have never changed it.</p>