Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Component Initialization Error: cannot read property 'g'

Asked by Ankit Yadav Jun 17, 2021 505 views 1 answer
Share

About this question

Everything was working fine with this component a couple days ago. Then I added an event and now I'm getting a strange error:

Uncaught Component class instance initialization error [Cannot read property 'g' of undefined] Callback failed: serviceComponent://ui.flexipage.components.page.FlexipageControllerV2/ACTION$getPage function: a.H.wd

Markup:

client side controller, I'm pretty sure it has to do with the init method because It says 'component initialization':

doInit : function(component, event, helper) { var questionlist = component.get("c.getQuestionList"); questionlist.setCallback(this, function(response){ var state = response.getState(); if(state == "SUCCESS"){ component.set("v.Questions",response.getReturnValue()); } }); component.set("v.index",0); $A.enqueueAction(questionlist); },

apex controller:

public class QuestionViewerController { @AuraEnabled public static List getQuestionList(){ return [Select id,body__c,answer__c,Name,Type__c,Explanation__c,Category__c From Question__c]; } }

Why getting Error: cannot read property 'g'?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.