1

Running into an issue with a deployment, getting a ton of errors of the following flavor:

line -1, column -1: Dependent class is invalid and needs recompilation: Class MeansRegisterCustomerTest : Constructor not defined: [LightningLoginFormController.VerifyResponse].<Constructor>() Stack Trace: null

Seems like the 'Compile all classes' option in Apex settings has worked for people with similar issues. Is there any risk in recompiling all Apex classes? I don't see how this could break something that was not already broken, but would like to hear people's thoughts on this before potentially breaking a bunch of code.

1 Answer 1

5

This error shouldn't occur during a deployment to production unless you're actually missing a file in your deployment (in this case, a unit test class is trying to reference a constructor that doesn't exist). This is because a deployment to production will always "compile all classes," so you shouldn't need to. Compile All Classes won't hurt, but it also likely won't help. The main reason you'd want to use Compile All Classes is to improve load time, or detect broken classes in a development org (Developer/Sandbox/Scratch). That said, there's no harm in trying to Compile All Classes and then seeing if your deployment succeeds. There's no way it can break anything that's not already broken.

1
  • Gotcha. Added a dummy constructor to the class in question and everything is looking good now. Cheers! Commented Apr 12, 2021 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .