twitter-api-ts icon indicating copy to clipboard operation
twitter-api-ts copied to clipboard

TypeError: oAuthWithDefaults.callback.toUndefined is not a function error

Open dotorimook opened this issue 4 years ago • 2 comments

Hello, I tried to follow the example in my node application, but I got following error.

Here's some of my code :

import {fetchHomeTimeline} from 'twitter-api-ts';
import {option} from 'fp-ts';


    fetchHomeTimeline({
      oAuth: {
        consumerKey: CONSUMER_KEY,
        consumerSecret: CONSUMER_SECRET,
        callback: CALLBACK,
        token: option.some(TOKEN),
        tokenSecret: option.some(TOKEN_SECRET),
        verifier: option.none,
      },
    }).run().then(response => {
console.log(response)
    });

Here is the error:

TypeError: oAuthWithDefaults.callback.toUndefined is not a function
    at Object.exports.fetchFromTwitter (E:\Project\playground\test-next-express-ts\node_modules\twitter-api-ts\src\index.ts:66:50)
    at exports.fetchHomeTimeline (E:\Project\playground\test-next-express-ts\node_modules\twitter-api-ts\src\index.ts:169:12)

What am I doing wrong? Please give me some help. Thanks.

dotorimook avatar Mar 11 '20 04:03 dotorimook

Please could you provide a full reduced test case? It might be your fp-ts version—this library currently uses an older version.

OliverJAsh avatar Mar 17 '20 15:03 OliverJAsh

The error seems to be at the callback param. I would guess you are not defining it.

Santiago8888 avatar Oct 27 '20 01:10 Santiago8888