A couple weeks ago, in the nightly test runs some tests started failing randomly (I guess it is related to the Summer'17 release.) I was not able to reproduce this, in console or Setup test runs they won't fail. This it the test-runner we are using.

Sometimes no tests fail, sometimes it's 30 or something in between. What they have in common is they have the same Error Message:

Dependent class is invalid and needs recompilation: Class AnyClass: Variable does not exist: fields

The classes are different, but they are all doing something like this:


The classes are either from the same package or another package, doesn't matter.

Anyone else experienced this? Any hint? any configuration? Is "fields" kind of deprecated?


Today also the tests in the developer console failed due to this error. After rerunning, they completed. BTW 2 of three packaging Orgs are affected by this.

  • 1
    We just started randomly receiving this error as well. Did you find a solution? It is happening in our production org that is still on Summer '17. But just started last week. – JRiffe Oct 3 '17 at 14:28
  • @JRiffe thanks for letting me know. I informed SF that others are experiencing this too. – Basti Oct 11 '17 at 9:26
  • @JRiffe are you still experiencing this? the last 30 days no tests failed in our orgs. – Basti Oct 18 '17 at 16:11
  • I would have said no yesterday. But seems it happened again last night where we received an exception email about it. – JRiffe Oct 27 '17 at 13:49

This is the answer I finally got from Support, seems like the new compiler fixed it [maybe ;)]. At least I'm not receiving this error anymore for the last month.

Hi Sebastian,

Thanks for your patience.

Since we have started the progress of upgrading the old compiler to the new one, it may have caused this intermittent issue to Apex tests. You will no longer have this issue.

  • 1
    Just ran into this with a subscriber org calling out managed package. It was falling over on a use of fields in the package. Will have the subscriber try recompiling all the Apex classes. – Daniel Ballinger Nov 28 '17 at 19:33
  • 1
    @DanielBallinger I will leave this unanswered since others are still experiencing this. Please keep us posted on your findings. thanks :) – Basti Nov 29 '17 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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