question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot convert undefined or null to object

See original GitHub issue

All 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:closed
  • Created 6 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jinwoocommented, Mar 7, 2018

@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.

0reactions
weissseancommented, May 13, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found