sf login functions jwt: TypeError: Cannot read properties of undefined (reading 'token')
I'm able to login to my org using sf login org jwt -a vdallano -i CLIENT_ID -f ../jwt/server.key -l https://test.salesforce.com -u USERNAME --json, but when I try sf login functions jwt -a vdallano -i CLIENT_ID -f ../jwt/server.key -l https://test.salesforce.com -u USERNAME --json I get the following error TypeError: Cannot read properties of undefined (reading 'token')


I just changed the word org to functions and hit enter. So what could be the problem?
I tried to update sf to the latest version but it didn't work

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
I am having the same issue on Jenkins slave - Debian:
@salesforce/cli/1.34.0 linux-x64 node-v16.15.1
While locally it works fine.
Hi, the same problem here. Could you help?
It only works with Prod orgs that have functions enabled. You both probably tried to login with a sandbox. As per doc, this seems to be working as designed.
The creds were for Production. The issue was that I was trying to log in to org and functions with an API-only user. WORKAROUND: But it requires standard UI login for the first time to accept the Functions access terms. After one-time UI login, I was able to do that with jwt. I guess it is a corner case to be covered by Salesforce.
I have described this issue and some others which I came across during implementing Salesforce Functions in CICD here - https://beyondthecloud.dev/blog/salesforce-functions-in-cicd Hope it helps