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
Sridhar Rana 5Sridhar Rana 5 

Getting this error quite often while running force:org:create: "Cannot read property 'details' of undefined". How to find out what is causing it?

Ajay K DubediAjay K Dubedi
Hi Sridhar,

Seems you are avoiding null checks in your code. Try using 
 
if(!$A.isUndefinedOrNull(field)){
    //Then try accessing your fetched values here
}

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
Sridhar Rana 5Sridhar Rana 5
Thanks Ajay for quick reply. Is there a way to figure out which file is throwing this error? I am simply trying to create a scratch org from VS Code Terminal and my project-scratch-def.json looks like below. Is there any other file which are involved in this step?
{
"orgName": "Rana OMR",
"edition": "Developer",
"features": ["PlatformCache"],
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"translation": true
}
}
}