- edited description
WINTER '23: "Cannot read properties of undefined (reading 'id')" during OAuth login
I’ve already heard from a few folks who have seen this error when logging in via OAuth (force:auth:web:login
CLI command or via IC2) after the Winter '23 preview update:
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.
One of these folks managed to figure out that it has to do with the Enhanced Domains update in this release where domain URLs have changed:
This looks like it relates to Enhanced Domains. This sandbox wasn’t on Enhanced Domains so after the weekend, the URL changed. I think it’s probably because sfdx was using the legacy URL, so the following ultimately fixed it:
sfdx auth:web:logout
sfdx auth:web:login – use the same alias and the new sandbox URL
So whether you’re using IC2 to create an OAuth connection to an org or doing so via the CLI, you likely need to specify the new login URL (with https
and not http
) explicitly via Organization Type => Other and Login URL in the IC2 Authorize Org dialog or via the -r
/--instanceurl
command-line argument.
Hopefully this helps at least a few folks who encounter this issue and are searching for a solution.
Comments (6)
-
reporter -
I will add that when specifying the -r option on the CLI make sure to use https and not http by mistake or you will get this error as well.
-
reporter - edited description
-
reporter Thanks, Eric. I’ve updated the original to include that detail in hopes that it helps someone avoid a failed first attempt.
-
Also here is the git issue around this which mentions a lot of the workarounds and the work item salesforce has against it just in case it is helpful
-
reporter - changed status to resolved
Issue tracker grooming.
- Log in to comment