0 votes

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

0 votes
Best answer

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.

Welcome to Memory Exceeded, where you can ask questions and receive answers from other members of the community.
You can donate any amount for Orphans village using following QR Code.