Looking at the code here , the router cannot deal with the "slug" part without specifying an identifier . The parser combinator does not declare it optional, and map ( ^^ ) explicitly uses it as is.
This may be a good function request if it does not cause other problems when the template hides all other routes, because it is defined above in the file (or even worse, included).
And it seems that this was done on purpose, if we look here , we can understand that the dynamic parameter cannot be assigned the default value - indeed, in this case we will fall in the case that I just mentioned: - /.
My first advice would be to tell you to use ignore as Option[String] and the definition of an action to set it to None (and not an empty String , because it is more expressive). My second would be to encourage you to wonder if such a case really matters, because it is error prone and may mask further problems.
source share