Cannot destructure property `client_secret` of 'undefined' or 'null'.
See original GitHub issueExpected Behavior
expected the script to work.
Actual Behavior
I got an error. const {client_secret, client_id, redirect_uris} = credentials.installed; ^
TypeError: Cannot destructure property client_secret
of ‘undefined’ or ‘null’.
at authorize (C:\Users\Mustafa Aygün\Desktop\code\emailer_test\quickstart.js:26:65)
at fs.readFile (C:\Users\Mustafa Aygün\Desktop\code\emailer_test\quickstart.js:16:3)
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
Steps to Reproduce the Problem
Specifications
- Node version (
node -v
) - OS (Mac/Linux/Windows)
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
node.js - cannot read property 'client_secret' of undefined
var clientSecret = credentials.installed.client_secret; In this line credentials is pointing to client_secret.json so the first key has to be "installed".
Read more >Cannot destructure Property of Undefined Error in JS
The "Cannot destructure property of undefined" error occurs when we try to destructure a property from a value that is equal to `undefined`....
Read more >Cannot Destructure Property 'Timeout' Of 'Undefined' Or 'Null'
Fixed an issue where Cloud Firestore didn't detect Authentication which led to permission This causes data to be returned which doesn't match the...
Read more >Cannot destructure property 'client_secret' of 'credentials ...
var clientSecret = credentials.installed.client_secret; In this line credentials is pointing to client_secret.json so the first key has to ...
Read more >Node.js quickstart | People API - Google Developers
The OAuth client created screen appears, showing your new Client ID and Client secret. Click OK. ... @return {Promise<OAuth2Client|null>}
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
var clientSecret = credentials.installed.client_secret; In this line credentials is pointing to client_secret.json so the first key has to be “installed”. In my case the key was “web” and that was causing the error. I just renamed the key “web” to “installed”.
thanks that was the only way to fix my issue