9

I have Intellij-IDEA 13.1.2. [edited, previously 13.0.2] I use the scala-plugin. I'm trying to use worksheets to evaluate code.

But all I got are two errors :

bad macro impl binding: versionFormat is supposed to be there
Unable to read an event from: rO0ABXNyADVvcmcuamV0YnJhaW5zLmpwcy5pbmNyZW1lbnRhbC...

I can run the scala console normally and execute my code in it, but the worksheet doesn't function. If my code is incorrect, it outputs an error indicating the interpreter failed to parse my code. I got the "bad macro impl binding" error only if my code is correct.

I tried creating a new project, but it didn't work. I followed tutorial to configure scala in intellij but it didn't help either.

Is there an important configuration step I may have missed ? What does that error mean ?

EDIT : I tried the simplest thing in my worksheet like 1 or var x = 1 or println("Hello World!")

EDIT2: I'm not sure what I changed but now I have another error : Error:error while loading MacroPrinter, class file needed by MacroPrinter is missing. reference value macros of package reflect refers to nonexisting symbol.

UPDATE: Now it works fine under Intellij 13.1.5, Scala plugin 0.41.2 with both scala-2.10 and 2.11

7
  • First of all, you could use the latest version. IntelliJ is at 13.1.2 with Scala plugin 0.35.654; worksheet is rather new, so I would except the newer the plugin the better
    – 0__
    Apr 22, 2014 at 19:21
  • Thanks, I also try that but I still get the same error ...
    – gwenzek
    Apr 24, 2014 at 11:52
  • Which the code you are trying to evaluate? You should include that in your question, otherwise it's difficult to tell where your problem lies.
    – 0__
    Apr 24, 2014 at 12:05
  • 1
    i got same quesion:```Error:error while loading MacroPrinter, class file needed by MacroPrinter is missing. reference value macros of package reflect refers to nonexisting symbol.````have you found the solution ? Apr 27, 2014 at 15:55
  • 1
    I manage to make it work. I installed the SBT module from intellij. This module downloaded a lot of thing and eventually fixed the problem.
    – gwenzek
    Apr 29, 2014 at 13:38

4 Answers 4

3

I had the "Unable to read an event from" issue and switching from Scala 2.11.0 to Scala 2.10.4 fixed it for me.

2
  • That did it for me as well. I wonder if this issue is fixed with 2.11.1.
    – Roberto
    Jun 9, 2014 at 20:39
  • I get the same error with Scala 2.11.1 (newest version).
    – Roberto
    Jun 9, 2014 at 20:47
2

I've shared a workaround in a similar question and I think it can work for this question as well:

I'm having the same issue with latest Idea and Scala plugin.
It seems that the worksheet has a problem executing any line which evaluates to Unit. Assigning is Unit, that's why your tableTest(0) = "zero" fails.

I've temporarily solved it with the following workaround:

this line will fail with error Error:Unable to read an event from:...

println("Will fail")

You can fix it by defining this helper method and using it for any Unit expression:

def unit(f: => Unit): String = {f; ""}
unit(println("Will work"))

You just have to ignore the line it generates in the output panel with res0: String = You also can put this method in some object and import in any WS you need.

1
  • Well, this helped me. At least it isolates the problem to statements which are returning Unit. And some of us can continue working on their assignments if with this bandaid.
    – Asad Iqbal
    Jul 21, 2014 at 10:12
1

I am using IntelliJIDEA 13.1.2 and Scala Plugin 0.36.431. I tried to create a Scala Non-SBT project and created a worksheet file, then I met the "bad macro impl binding" problem. But if I created a Scala SBT project with a worksheet file, it worked well.

1
  • Yes it also works for me, Ithink it's because SBT uses scala 2.10 by default
    – gwenzek
    May 21, 2014 at 6:42
1

After updating to IntelliJ 13.1.5 build 135.1289 with JRE 1.7.0_60 and Scala 2.11.0 I had the same issue.

I fixed the problem by disabling the checkbox in settings -> IDE Settings -> Scala -> "Run compile server".

1
  • You are a genius! Nothing else worked for me, but this did!! Thank you!!! Oct 18, 2017 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.