Salesforce CLI – SFDX – Cannot read properties of undefined (reading ‘id’)

Reading Time: < 1 minutes
When running the command that makes the login against our Sandbox org, it redirects to a localhost URL and then it display an error that doesn’t give us so much information
      sfdx auth:web:login -a --instanceurl=

The error

Cannot read properties of undefined (reading ‘id’)
This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.
This error can be related to the enhanced domain enabled or just the wrong URL typed in the login command. Read more about
Enhanced Domain enabled


To fix this error, add just “sandbox” to the URL so the pattern must be “xxxxxx–”

      sfdx auth:web:login -a --instanceurl=
Photo by Markus Spiske on Unsplash

About the author

Andrés Canavesi
Andrés Canavesi

Software Engineer with 15+ experience in software development, specialized in Salesforce, Java and Node.js.

Related posts

Leave a Reply

%d bloggers like this: