http4s/http4s.g8

g8 templates for version 0.19.0-x fail compie

kayvank opened this issue · 2 comments

Here are the steps:

sbt -sbt-version 0.13.15 new http4s/http4s.g8
select 0.19
cd quickstart
sbt compile
quickstart/src/main/scala/com/example/quickstart/HelloWorldServer.scala:19:18: IO takes no type parameters, expected: one [error] BlazeBuilder[IO] [error] ^ [error] /home/kayvan/tmp/quickstart/src/main/scala/com/example/quickstart/HelloWorldServer.scala:21:21: diverging implicit expansion for type cats.effect.Effect[F] [error] starting with method catsWriterTEffect in object Effect [error] .mountService(helloWorldService, "/") [error] ^ [error] /home/kayvan/tmp/quickstart/src/main/scala/com/example/quickstart/HelloWorldServer.scala:11:83: class IO takes type parameters [error] def stream(args: List[String], requestShutdown: IO[Unit]) = ServerStream.stream[IO] [error] ^ [error] three errors found [error] (Compile / compileIncremental) Compilation failed [error] Total time: 1 s, completed Aug 23, 2018 6:40:43 PM

Here is what I did to resolve the issue:
add to build.sbt
"org.typelevel" %% "cats-effect" % "1.0.0-RC3",
`
object HelloWorldServer extends IOApp {

    def run(args: List[String]): IO[ExitCode] = {

            BlazeBuilder[IO]
              .bindHttp(8080, "0.0.0.0")
              .mountService(HelloWorldService.service, "/")
              .serve.compile.drain.as(ExitCode.Success)
    }}

`

I think the above linked ticket is the problem: the default branch of the g8 template is for version 0.18, but you selected version 0.19. That needs the corresponding branch of the template. This is our fault: the quickstart for the development docs didn't specify the branch.

If this doesn't work for you, please reopen.

Also note that cats-effect-1.0.0.RC3 is not binary compatible with 0.19.0-M1. We're still working on the the latest dependencies, but will release a new milestone ASAP.