makara-filip / ts-messenger-api

The unofficial API for FB Messenger communication
MIT License
50 stars 13 forks source link

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'subtle' of undefined #5

Closed hoangvu12 closed 3 years ago

hoangvu12 commented 3 years ago
(node:12420) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'subtle' of undefined
    at Object.<anonymous> (\node_modules\ts-messenger-api\dist\lib\passwordHasher.js:42:41)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\Users\nguyenvu\Desktop\nguyenvu\hentai-bot\node_modules\ts-messenger-api\dist\index.js:308:42
    at step (C:\Users\nguyenvu\Desktop\nguyenvu\hentai-bot\node_modules\ts-messenger-api\dist\index.js:52:23)
    at Object.next (C:\Users\nguyenvu\Desktop\nguyenvu\hentai-bot\node_modules\ts-messenger-api\dist\index.js:33:53)
(node:12420) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:12420) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I keep getting this error when trying to login in.

Edit: Uh can't import crypto module I guess.

makara-filip commented 3 years ago

Which Node version do you use? The error is caused by the import of the crypto module. Try to update your Node version to v15 to fix that error.

hoangvu12 commented 3 years ago

Which Node version do you use? The error is caused by the import of the crypto module. Try to update your Node version to v15 to fix that error.

My bad, I forgot I haven't updated my nodejs. Upgraded node version to v15 solved this problem.