If you face “Cannot read property of ud undefined” in Salesforce Lightning, follow the below steps.
1. Check whether you are using any reference to Apex Class in the Component controller.
2. Don’t forget to use controller attribute to link the controller to the Component.