lihaoyi / scala-js-fiddle

Source code for Scala.jsFiddle
www.scala-js-fiddle.com
85 stars 62 forks source link

Compiling code with macros results in error #10

Open shadaj opened 9 years ago

shadaj commented 9 years ago

Compiling the last two examples from the homepage of http://scala-js-fiddle.com results in an error:

Main.scala:62: error: macro implementation not found: async
(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
    async{
         ^

and

Main.scala:293: error: macro implementation not found: foreach
(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
      for (x <- 0 until canvas.width optimized){
             ^
sjrd commented 9 years ago

Do you declare the right dependencies to the libraries providing these macros? What does your libraryDependencies look like? For the async stuff it should contain something like this:

libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.2" % "provided"

This should work just fine out of the box.

If it doesn't, please provide a link to a branch in a GitHub repo exhibiting the error. Or at least the content of your build.sbt and Main.scala.

lihaoyi commented 9 years ago

Looks like this happened after my move from ec2 to heroku. I bet the classloading used to make macros doesn't work on their filesystem layout or something.

On Tue, Jan 20, 2015 at 4:02 PM, Sébastien Doeraene < notifications@github.com> wrote:

Do you declare the right dependencies to the libraries providing these macros? What does your libraryDependencies look like? For the async stuff it should contain something like this:

libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.2" % "provided"

This should work just fine out of the box.

If it doesn't, please provide a link to a branch in a GitHub repo exhibiting the error. Or at least the content of your build.sbt and Main.scala.

— Reply to this email directly or view it on GitHub https://github.com/lihaoyi/scala-js-fiddle/issues/10#issuecomment-70760195 .

shadaj commented 9 years ago

I'm not running the server locally, the error is occurring on the hosted server. For example, http://www.scala-js-fiddle.com/gist/9443f8e0ecc68d1058ad/RayTracer.scala does not compile.

lihaoyi commented 9 years ago

Yeah I saw that. It's hosted on heroku now, after I moved it from EC2, and I suspect that move is the cause of the problem

On Tue, Jan 20, 2015 at 5:17 PM, Shadaj notifications@github.com wrote:

I'm not running the server locally, the error is occurring on the hosted server. For example, http://www.scala-js-fiddle.com/gist/9443f8e0ecc68d1058ad/RayTracer.scala does not compile.

— Reply to this email directly or view it on GitHub https://github.com/lihaoyi/scala-js-fiddle/issues/10#issuecomment-70767898 .