Twit module을 사용하여 AngularJS 앱에서 Twitter 스트림을 표시하고 있습니다. 사용자가 중지 버튼을 클릭 할 때 스트림을 끄는 옵션을 제공하려고합니다.Nodejs 스트림 중지시 Twit 모듈 오류가 발생했습니다.
스트리밍 처리하는 스크립트 : 다음과 같은 오류를 출력 콘솔을 중지 버튼을 누른 후
var Twit = require('twit');
var T = new Twit({
consumer_key : 'XXX',
consumer_secret : 'XXX',
access_token : 'XXX',
access_token_secret : 'XXX'
});
function streamingHashtag(streamBool)
{
var stream = T.stream('statuses/filter', { track: 'test' });
stream.on('tweet', function (tweet) {
console.log(tweet);
});
stream.on('disconnect',function(disconnectMessage){
stream.stop();
});
if(streamBool == false){
stream.stop();
console.log('Stream stopped by user');
}
}
및 스트림이 계속 :
message: "Cannot call method 'abort' of undefined", stack: "TypeError: Cannot call method 'abort' of undefined…es\connect\lib\middleware\methodOverride.js:37:5)"}
message: "Cannot call method 'abort' of undefined"
stack: "TypeError: Cannot call method 'abort' of undefined? at OARequest.stop ([localhost]\node_modules\twit\lib\oarequest.js:110:16)? at Object.streamingHashtag ([localhost]\server\library\twitter.js:40:10)? at exports.twitterStream ([localhost]\server\routes\index.js:11:10)? at callbacks ([localhost]\node_modules\express\lib\router\index.js:161:37)? at param ([localhost]\node_modules\express\lib\router\index.js:135:11)? at pass ([localhost]\node_modules\express\lib\router\index.js:142:5)? at Router._dispatch ([localhost]\node_modules\express\lib\router\index.js:170:5)? at Object.router ([localhost]\node_modules\express\lib\router\index.js:33:10)? at next ([localhost]\node_modules\express\node_modules\connect\lib\proto.js:190:15)? at Object.methodOverride [as handle] ([localhost]\node_modules\express\node_modules\connect\lib\middleware\methodOverride.js:37:5)"
나는 최신 버전을 실행하고있어 (package.json은 "version": "1.1.11"이라고 말함) 조사한 결과 OARequest.js에서 abort()를 지시하는 stop 함수를 발견했습니다.
내가 뭘 잘못하고 있니?