“value ? is not a member of akka.actor.ActorRef”

I was trying to use a Future in Akka today and got the following error message:

value ? is not a member of akka.actor.ActorRef

It turns out you have to import the akka.pattern.ask to use ‘?’. There is a implicit conversion from ActorRef to AskableActorRef.

So add the following import and you should be set to go (take note that ask does not start with a capital:

import akka.pattern.ask

3 thoughts on ““value ? is not a member of akka.actor.ActorRef”

  1. Update — new import is import akka.actor.typed.scaladsl.AskPattern._

Leave a comment