TypeError: Cannot convert undefined or null to object
See original GitHub issueAll I’m doing is: var {google} = require(‘googleapis’) as the instructions by Google say to do.
I’m getting “Cannot convert undefined or null to object” error.
The error is happening around pify.
Tried to run the example in “Test googleapis in your browser” but it still fails.
Tried to manually add the required and included dependencies without success.
Running the latest node, npm, and googleapis release versions. What am I doing wrong here?
Tried both
import {google} from 'googleapis';
and
var {google} = require('googleapis')
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Cannot convert undefined or null to object - Stack Overflow
Generic answer. This error is caused when you call a function that expects an Object as its argument, but pass undefined or null...
Read more >Cannot convert undefined or null to Object in JavaScript
The "Cannot convert undefined or null to Object" error occurs when we pass a null or an undefined value to a function that...
Read more >Object.keys(null) possible - cannot convert undefined or null to ...
Conditions above this line allow msg===null to get into Object.keys(msg);. livedata_connection.js:1626 Uncaught TypeError: Cannot convert ...
Read more >Cannot convert undefined or null to object - JavaScript
JavaScript : How to resolve TypeError : Cannot convert undefined or null to object [ Gift : Animated Search Engine ...
Read more >Cannot convert undefined or null to object at Function.entries
This page uses a programList object provided by Wix that lists all the program. I noticed that whenever I get the concerned error...
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 FreeTop 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
Top GitHub Comments
@weisssean I don’t think anyone but you can reproduce your issue with version 27. Just to make sure, are you running this on the server side or on the browser side? I don’t think this library runs on the browser.
If I remember correctly all it was was that I tried to import and use this on the client instead of the server. What you want to do is create an express.js server and routes for your app and implement it for those routes. There are many tutorials on how to create server side for your application, it’s pretty easy (the basics at least). Good luck.