Facebook-chat-api: TypeError: Cannot read property 'successful_results' of undefined

Created on 30 Aug 2020  路  6Comments  路  Source: Schmavery/facebook-chat-api

weird error after logged in
info login Logged in info login Request to reconnect info login Done logging in. ERR! getSeqId TypeError: Cannot read property 'successful_results' of undefined ERR! getSeqId at /root/log/node_modules/facebook-chat-api/src/listenMqtt.js:532:41 ERR! getSeqId at tryCatcher (/root/log/node_modules/bluebird/js/release/util.js:16:23) ERR! getSeqId at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:547:31) ERR! getSeqId at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) ERR! getSeqId at Promise._settlePromise0 (/root/log/node_modules/bluebird/js/release/promise.js:649:10) ERR! getSeqId at Promise._settlePromises (/root/log/node_modules/bluebird/js/release/promise.js:729:18) ERR! getSeqId at Promise._fulfill (/root/log/node_modules/bluebird/js/release/promise.js:673:18) ERR! getSeqId at Promise._resolveCallback (/root/log/node_modules/bluebird/js/release/promise.js:489:14) ERR! getSeqId at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:559:17) ERR! getSeqId at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) ERR! getSeqId at Promise._settlePromise0 (/root/log/node_modules/bluebird/js/release/promise.js:649:10) ERR! getSeqId at Promise._settlePromises (/root/log/node_modules/bluebird/js/release/promise.js:729:18) ERR! getSeqId at Promise._fulfill (/root/log/node_modules/bluebird/js/release/promise.js:673:18) ERR! getSeqId at Promise._resolveCallback (/root/log/node_modules/bluebird/js/release/promise.js:466:57) ERR! getSeqId at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:559:17) ERR! getSeqId at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) ERR! getSeqId TypeError: Cannot read property 'successful_results' of undefined ERR! getSeqId at /root/log/node_modules/facebook-chat-api/src/listenMqtt.js:532:41 ERR! getSeqId at tryCatcher (/root/log/node_modules/bluebird/js/release/util.js:16:23) ERR! getSeqId at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:547:31) ERR! getSeqId at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) ERR! getSeqId at Promise._settlePromise0 (/root/log/node_modules/bluebird/js/release/promise.js:649:10) ERR! getSeqId at Promise._settlePromises (/root/log/node_modules/bluebird/js/release/promise.js:729:18) ERR! getSeqId at Promise._fulfill (/root/log/node_modules/bluebird/js/release/promise.js:673:18) ERR! getSeqId at Promise._resolveCallback (/root/log/node_modules/bluebird/js/release/promise.js:489:14) ERR! getSeqId at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:559:17) ERR! getSeqId at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) ERR! getSeqId at Promise._settlePromise0 (/root/log/node_modules/bluebird/js/release/promise.js:649:10) ERR! getSeqId at Promise._settlePromises (/root/log/node_modules/bluebird/js/release/promise.js:729:18) ERR! getSeqId at Promise._fulfill (/root/log/node_modules/bluebird/js/release/promise.js:673:18) ERR! getSeqId at Promise._resolveCallback (/root/log/node_modules/bluebird/js/release/promise.js:466:57) ERR! getSeqId at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:559:17) ERR! getSeqId at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) TypeError: Cannot read property 'successful_results' of undefined at /root/log/node_modules/facebook-chat-api/src/listenMqtt.js:532:41 at tryCatcher (/root/log/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/root/log/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/root/log/node_modules/bluebird/js/release/promise.js:729:18) at Promise._fulfill (/root/log/node_modules/bluebird/js/release/promise.js:673:18) at Promise._resolveCallback (/root/log/node_modules/bluebird/js/release/promise.js:489:14) at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:559:17) at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/root/log/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/root/log/node_modules/bluebird/js/release/promise.js:729:18) at Promise._fulfill (/root/log/node_modules/bluebird/js/release/promise.js:673:18) at Promise._resolveCallback (/root/log/node_modules/bluebird/js/release/promise.js:466:57) at Promise._settlePromiseFromHandler (/root/log/node_modules/bluebird/js/release/promise.js:559:17) at Promise._settlePromise (/root/log/node_modules/bluebird/js/release/promise.js:604:18)
i tried update facebook-chat-api but this still happening any idea?

Most helpful comment

I found one solution for this issue. You can set the custom userAgent as below, and the return data is not corrupted for the new Facebook UI

options: { forceLogin: true, logLevel: /^win/.test(process.platform) ? 'verbose' : 'warn', listenEvents: true, // selfListen: true, updatePresence: true, autoMarkDelivery: true, autoMarkRead: true, userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Mobile Safari/537.36' }

@royalgarter I've tried your userAgent mentioned above but it still does not work
do you have any known temporary fix for this?

edit: It does work I had to get appState again. thanks!

All 6 comments

Any solution for this issue?

Its the same issue with https://github.com/Schmavery/facebook-chat-api/issues/826. The reason is the new Facebook UI. But we dont have a fix yet.

I found one solution for this issue. You can set the custom userAgent as below, and the return data is not corrupted for the new Facebook UI

options: { forceLogin: true, logLevel: /^win/.test(process.platform) ? 'verbose' : 'warn', listenEvents: true, // selfListen: true, updatePresence: true, autoMarkDelivery: true, autoMarkRead: true, userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Mobile Safari/537.36' }

I found one solution for this issue. You can set the custom userAgent as below, and the return data is not corrupted for the new Facebook UI

options: { forceLogin: true, logLevel: /^win/.test(process.platform) ? 'verbose' : 'warn', listenEvents: true, // selfListen: true, updatePresence: true, autoMarkDelivery: true, autoMarkRead: true, userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Mobile Safari/537.36' }

This solution does no longer work (AFAIK it's because FB is starting to push out the new UI to some user no matter what)

The API was working for me without this hack and a few requests later it started to happen. This hack does not fix the issue.

EDIT: Oh, that's because my account got locked, nevermind

I found one solution for this issue. You can set the custom userAgent as below, and the return data is not corrupted for the new Facebook UI

options: { forceLogin: true, logLevel: /^win/.test(process.platform) ? 'verbose' : 'warn', listenEvents: true, // selfListen: true, updatePresence: true, autoMarkDelivery: true, autoMarkRead: true, userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Mobile Safari/537.36' }

@royalgarter I've tried your userAgent mentioned above but it still does not work
do you have any known temporary fix for this?

edit: It does work I had to get appState again. thanks!

Same problem. Until the appstate.json file isn't available my app will give me the error of the issue. After that the file is created, my app started working fine. I hope that a fix will be available soon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GEOFBOT picture GEOFBOT  路  4Comments

thaspoom picture thaspoom  路  5Comments

tarungog picture tarungog  路  3Comments

ravkr picture ravkr  路  7Comments

WaffleCohn picture WaffleCohn  路  6Comments