Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined. #917

Open
KnuddelsMasterChris opened this issue Apr 5, 2022 · 7 comments

Comments

@KnuddelsMasterChris
Copy link

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

Specifications

  • Node version (node -v):
  • Version (clasp -v):
  • OS (Mac/Linux/Windows):
@andkirby
Copy link

My case:

$ clasp login --creds .clasprc.json
Warning: You seem to already be logged in *locally*. You have a ./.clasprc.json
Logging in locally…

Authorizing with the following scopes:
https://www.googleapis.com/auth/script.container.ui
https://www.googleapis.com/auth/script
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/script.webapp.deploy

NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes

Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.

It's really not clear what should I fix...

@andkirby
Copy link

andkirby commented Jun 22, 2022

Another question:
How options.creds.installed shall be defined in a local credentials file?
It is mentioned in:
https://github.com/google/clasp/blame/e851215b8abe4de282c62c4d61076c85e89a56ba/src/auth.ts#L113
I don't see any way to generate such .clasprc.json with installed property.

@paul-messina-mm
Copy link

Same with
node v14.18.2
clasp 2.4.1
on MacOs Big Sur 11.6.4

clasp login --creds .clasprc.json 
Warning: You seem to already be logged in *locally*. You have a ./.clasprc.json
Logging in locally…

Authorizing with the following scopes:
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/script.webapp.deploy

NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes

Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.

@sbwrege2z
Copy link

Same for me.

node v12.20.1
clasp v2.4.2

clasp login --creds ./credentials/clasp-trn-creds.json                             1 ↵  9012  12:16:18
Logging in locally…

Authorizing with the following scopes:
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/script.scriptapp
https://www.googleapis.com/auth/script.container.ui
https://www.googleapis.com/auth/script.webapp.deploy

NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes

Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.

@bdetry
Copy link

bdetry commented Dec 30, 2022

Almost the same issue here when trying clasp login --creds with a service account key file.

I have added the installed json key and got this error :

Error retrieving access token: TypeError: Cannot read properties of undefined (reading '0')

@vlad-yavorsky
Copy link

vlad-yavorsky commented Jan 22, 2023

This answer helped me: https://stackoverflow.com/a/65456893/8668096
or this: https://stackoverflow.com/a/43640000

@lgnashold
Copy link

Still experiencing this. It's also not even clear from the documentation how to create an account locally, or the distinction between a local and global account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants