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

'TypeError: undefined is not a function' when trying to look at the inbox #40

Closed
hanshasselberg opened this issue Jul 3, 2015 · 7 comments
Assignees

Comments

@hanshasselberg
Copy link

Hi,

this looks like a great project. I installed it, but there seems to be something wrong.

$ wunderline inbox
/usr/local/lib/node_modules/wunderline/util/get-inbox.js:22
    var lists = body.filter(function (item) {
                     ^
TypeError: undefined is not a function
    at Request._callback (/usr/local/lib/node_modules/wunderline/util/get-inbox.js:22:22)
    at Request.self.callback (/usr/local/lib/node_modules/wunderline/node_modules/request/request.js:197:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/wunderline/node_modules/request/request.js:1050:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/wunderline/node_modules/request/request.js:996:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16

Thanks,
Hans

@wayneashleyberry
Copy link
Owner

Hi @i0rek, it looks like an authentication error, have you set up your .wunderlinerc file?

@hanshasselberg
Copy link
Author

@wayneashleyberry yes.

cat ~/.wunderlinerc
{
  "client_id": "..........................",
  "access_token": "..............................."
}

wayneashleyberry added a commit that referenced this issue Jul 3, 2015
@wayneashleyberry
Copy link
Owner

Just pushed a potential fix, would you mind installing 3.2.2?

@hanshasselberg
Copy link
Author

Thank you for the fast help! That doesn't fix my issue though:

$ wunderline --version
3.2.2
$ wunderline inbox
/usr/local/lib/node_modules/wunderline/util/get-inbox.js:22
    var lists = body.filter(function (item) {
                     ^
TypeError: undefined is not a function
    at Request._callback (/usr/local/lib/node_modules/wunderline/util/get-inbox.js:22:22)
    at Request.self.callback (/usr/local/lib/node_modules/wunderline/node_modules/request/request.js:197:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/wunderline/node_modules/request/request.js:1050:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/wunderline/node_modules/request/request.js:996:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

@wayneashleyberry
Copy link
Owner

Strange... okay, i've added some extra debugging in 3.2.3

If you could run NODE_DEBUG=request wunderline inbox and add the debugging output here that would really help :)

Looks like, for some reason, the API call to /lists is returning an empty body...

@wayneashleyberry wayneashleyberry self-assigned this Jul 3, 2015
@hanshasselberg
Copy link
Author

With debugging enabled I saw that I was unauthorised. I used the client_secret as access_token. Generating an access token fixed it.
Thanks!

@wayneashleyberry
Copy link
Owner

Oh cool - yeah, I need to add better error messages for that, will add it to my todo list :p

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

2 participants