I'm seeing this error with scala-3.3.0 and akka (or pekko):
dotty.tools.FatalError: cannot resolve reference to type akka.stream.scaladsl.type.Source
dotty.tools.FatalError: cannot resolve reference to type org.apache.pekko.stream.scaladsl.type.Source
In both cases I see no such reference in any of the sources or dependencies.
To demonstrate the problem, I created a small GitHub repo: https://github.com/abrighton/scala3-test
The main branch uses pekko and the "akka-version" branch uses akka. Both use java-17 and scala-3.3.0.
The closest issue I could find that might be related was: https://github.com/lampepfl/dotty/pull/16373
Any ideas what could be causing this?
You are using pekko-http as a dependency
The Pekko HTTP modules implement a full server- and client-side HTTP stack on top of
pekko-actor
andpekko-stream
.
Which means you need to have also the dependencies pekko-actor and pekko-stream added in the classpath.
Just adding
libraryDependencies += "org.apache.pekko" %% "pekko-stream" % PekkoVersion
should fix your problem.
Side Note:
Not sure if the docs are incomplete or a hello world for pekko-http
is hard to find. Checking the Pekko Modules, pekko-stream
is not listed. I couldn't find g8 template
or something similar.
Just based on the error message you shared
dotty.tools.FatalError: cannot resolve reference to type akka.stream.scaladsl.type.Source
dotty.tools.FatalError: cannot resolve reference to type org.apache.pekko.stream.scaladsl.type.Source
And knowing that Source
comes from the stream
module, I took a wild guess and added the pekko-stream
dependency and the compilation succeed.
EDIT:
found a pekko http quickstart template