Symbol 'type' is missing from the classpath

I’m learning Scala and following this video Akka HTTP & JSON: Integrating Spray, Circe and Jackson with Akka HTTP, with Scala | Rock the JVM - YouTube But when I tried to run my AkkaHttpJson class I end up getting this error

Symbol ‘type’ is missing from the classpath. This symbol is required by ‘method akka.http.scaladsl.server.RouteResult.routeToFlow’. Make sure that type Flow is in your classpath and check for conflicting dependencies with -Ylog-classpath. A full rebuild may help if ‘RouteResult.class’ was compiled against an incompatible version of Http().newServerAt(“localhost”, 8081).bind(route)

Why am I getting this error? Everything is exactly as shown in the video. Is it the dependencies that are causing these issues? Also, If I make a project using Scala 2.* and then want to convert to Scala 3, would I always face issues?

I’m really new to Scala, so I appreciate all help!

That video is quite old (2.5 years) so you are probably having version issues.
First of all make sure you have at least Java 11 or newer. And get the latest SBT, which is 1.8.2.
Then use this template for Akka HTTP: GitHub - akka/akka-http-quickstart-scala.g8 it was updated 3 months ago so it should be good.

With these in place, I can do (just hitting Enter):

 ➜ sbt new akka/akka-http-quickstart-scala.g8
[info] welcome to sbt 1.8.2 (Ubuntu Java 11.0.17)
[info] set current project to new (in build file:/tmp/sbt_32a64ab0/new/)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
This is a seed project which creates a basic build for an Akka HTTP 
application using Scala. 

name [My Akka HTTP Project]: 
scala_version [2.13.4]: 
akka_http_version [10.4.0]: 
akka_version [2.7.0]: 
sbt_version [1.8.2]: 
organization [com.example]: 
package [com.example]: 

Template applied in /home/spam/Public/./my-akka-http-project


 ➜ cd my-akka-http-project

 ➜ sbt
[info] welcome to sbt 1.8.2 (Ubuntu Java 11.0.17)
[info] loading settings for project my-akka-http-project-build from plugins.sbt ...
[info] loading project definition from /home/spam/Public/my-akka-http-project/project
[info] loading settings for project root from build.sbt ...
[info] set current project to My Akka HTTP Project (in build file:/home/spam/Public/my-akka-http-project/)
[info] sbt server started at local:///home/spam/.sbt/1.0/server/be3edb2abbd56e43f695/sock
[info] started sbt server
sbt:My Akka HTTP Project> compile
[info] Updating

(a whole bunch of Maven messages...)

[info] Fetched artifacts of 
[info] compiling 4 Scala sources to /home/spam/Public/my-akka-http-project/target/scala-2.13/classes ...
[info] Non-compiled module 'compiler-bridge_2.13' for Scala 2.13.4. Compiling...
[info]   Compilation completed in 11.752s.
[success] Total time: 59 s, completed Jan 27, 2023, 10:45:17 AM
sbt:My Akka HTTP Project> 

You can also increase Scala version to 2.13.10 in build.sbt (then do reload and compile again), but Scala 3 versions do not work; I guess some dependencies have not been ported to Scala 3 yet.

If you are new to Scala I highly recommend avoiding this advanced Akka stuff for now, and starting with Programming in Scala, Fifth Edition As good as Rock the JVM is, you need the basics first.