function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VSK98VSK98 

Getting the Error Failed to initialize a component [Expected ';']

Hi All,

Getting the error after user loggedin into Salesforce via lightning. 

Error:
Failed to initialize a component [Expected ';']
I have kept debugging particular user.
02:49:59.16 (16402720)|CUMULATIVE_LIMIT_USAGE_END

02:49:59.0 (16549420)|CODE_UNIT_FINISHED|MTS_callGroupCustomers.fetchUser()
02:49:59.0 (16690971)|CODE_UNIT_FINISHED|Aura
02:49:59.0 (18404546)|EXECUTION_FINISHED
02:49:59.30 (30371394)|CUMULATIVE_PROFILING_BEGIN
02:49:59.30 (30371394)|CUMULATIVE_PROFILING|SOQL operations|
Class.MTS_callGroupCustomers.fetchUser: line 22, column 1: [select id,Name,Username,Alias,Country,Email,FirstName,LastName,IsActive 
                      FROM User Where id =: userInfo.getUserId() limit 1]: executed 1 time in 12 ms

02:49:59.30 (30371394)|CUMULATIVE_PROFILING|No profiling information for SOSL operations
02:49:59.30 (30371394)|CUMULATIVE_PROFILING|No profiling information for DML operations
02:49:59.30 (30371394)|CUMULATIVE_PROFILING|method invocations|
External entry point: public static User fetchUser(): executed 1 time in 14 ms
Class.MTS_callGroupCustomers.fetchUser: line 23, column 1: global static String getUserId(): executed 1 time in 0 ms

02:49:59.30 (30371394)|CUMULATIVE_PROFILING_END

Apex class:
 
@AuraEnabled 
    public Static user fetchUser(){
  
        // query current user information  
        User oUser = [select id,Name,Email,IsActive 
                      FROM User Where id =: userInfo.getUserId() limit 1];
               
        return oUser;
    }

Regards,
VSK98​​​​​​​ 
 
Raj VakatiRaj Vakati
Looks like error is coming from another method ..can share the complete code and try this code
 
@AuraEnabled 
    public Static user fetchUser(){
  
        // query current user information  
        User oUser = [select id,Name,Email,IsActive 
                      FROM User Where id =: UserInfo.getUserId() limit 1];
               
        return oUser;
    }