Uncaught TypeError: Expected `input` to be a `Function` or `Object`, got `undefined`
See original GitHub issueHi, I have got the issue while accessing the google sheet API. I tried to Google Sheets API (https://developers.google.com/sheets/api/quickstart/nodejs). And made it as npm package while tried to include the package in new project. i got an issue
Uncaught TypeError: Expected input to be a Function or Object, got undefined at module.exports (index.js?2556:45) at eval (index.js?f447:22) at Object../node_modules/gtoken/build/src/index.js (app.js:5720) at __webpack_require__ (app.js:724) at fn (app.js:101) at eval (jwtclient.js?d465:63) at Object../node_modules/google-auth-library/build/src/auth/jwtclient.js (app.js:3154) at __webpack_require__ (app.js:724) at fn (app.js:101) at Object.eval (googleauth.js?0a40:73)
Please fix the issue Ref: https://stackoverflow.com/questions/54468809/what-is-causing-typeerror-expected-input-to-be-a-function-or-object-issue/54920596#54920596
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (6 by maintainers)
Top GitHub Comments
@ozydingo 👋 Node.js is a thin layer on top of the V8 JavaScript parser (which is the same JavaScript parser used by Chromium).
Depending on what APIs are used, the same source will sometimes work in Node.js and the browser; there are a few cases where this compatibility can break down:
fs
,http
, etc).I’ve created an issue related to us better documenting these compatibility issues 👍
You can follow the progress here:
https://github.com/googleapis/google-cloud-node/issues/2918
The error seems to be thrown by this line in the
gtoken
module:The error indicates that
fs.readFile
is undefined. Your stack trace mentioned Webpack, are you by any chance trying to package up this library for use on the client side? That would explain whyfs.readFile
isn’t defined.