twitter-api-ts
twitter-api-ts copied to clipboard
TypeError: oAuthWithDefaults.callback.toUndefined is not a function error
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.
Please could you provide a full reduced test case? It might be your fp-ts
version—this library currently uses an older version.
The error seems to be at the callback param. I would guess you are not defining it.