We used nested classes in LWC controller to have a single class with all the AuraEnabled parameters. That works in a no-namespace environment but stops working when we either package that or deploy to a scratch org with a namespace.

It throws the following internal error: An internal server error has occurred↵Error ID: 1249622784-2726276 (1294986922)

I created a repo with the code sample to illustrate the issue on Github


Turned out the problem is how AuraEnabled handles the namespaces. Currently, it's just impossible to use nested classes in namespaced Aura.

This is true for regular (non-LWC) Aura as well, but has a workaround.

I posted an idea to Salesforce to fix that.

I'm also talking to the TE team and partner support on this. They should get it to the platform team.

At this moment the only workaround for LWC I found is to not use nested classes ¯\_(ツ)_/¯


Salesforce support reached out to me and provided a link to the known issue, which is marked as "No fix". They also advised me to promote the idea. So anyone interested in this - please vote for the idea.

  • As an ISV with a namespaced environment it feels like they don't care about the likes of us too much – zaitsman Jan 24 '20 at 5:26
  • Well, at least the TE I was talking to promised to ping their Platform team. I'll keep in touch with her to see where it goes and will update this ticket with any information on this defect – nchursin Jan 24 '20 at 8:32

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.