Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'request' of undefined #1824

Closed
duongvanba opened this issue Aug 7, 2021 · 3 comments
Closed

TypeError: Cannot read property 'request' of undefined #1824

duongvanba opened this issue Aug 7, 2021 · 3 comments

Comments

@duongvanba
Copy link

duongvanba commented Aug 7, 2021

Describe the bug

I have this problem when try to connect facebook. This problem happend after about several hours after app restarted. I don't know why

  • Node.js version: v15.5.0
  • OS & version: Ubuntu 18.04

Actual behavior

4|vipbvls  | TypeError: Cannot read property 'request' of undefined
4|vipbvls  |     at /root/code/server/node_modules/got/dist/source/as-promise/index.js:157:48
4|vipbvls  |     at runMicrotasks (<anonymous>)
4|vipbvls  |     at processTicksAndRejections (node:internal/process/task_queues:93:5)
4|vipbvls  |     at async FacebookAndroidAPI.graphql (/root/code/server/build/src/libs/FacebookAndroidAPI.js:31:22)
4|vipbvls  |     at async FacebookAndroidAPI.get_page_feed_stories (/root/code/server/build/src/libs/FacebookAndroidAPI.js:303:22)
4|vipbvls  |     at async VipBvlcScanner.list_livestream (/root/code/server/build/src/modules/vip-bvls/scanner.js:150:26)
4|vipbvls  |     at async VipBvlcScanner.scan (/root/code/server/build/src/modules/vip-bvls/scanner.js:90:32)
4|vipbvls  |     at async VipBvlcScanner.cron (/root/code/server/build/src/modules/vip-bvls/scanner.js:160:9)
4|vipbvls  |     at async /root/code/server/build/src/decorators/CronJob.js:11:13

/root/code/server/node_modules/got/dist/source/as-promise/index.js:157:48

const shortcut = (responseType) => {
       const newPromise = (async () => {
           // Wait until downloading has ended
           await promise;
           const { options } = globalResponse.request; // <= globalResponse undefined ?? ?? ?? 
           return parse_body_1.default(globalResponse, responseType, options.parseJson, options.encoding);
       })();
       Object.defineProperties(newPromise, Object.getOwnPropertyDescriptors(promise));
       return newPromise;
   };

Checklist

  • [x ] I have read the documentation.
  • [x ] I have tried my code with the latest version of Node.js and Got.
@szmarczak
Copy link
Collaborator

Looks like #1543 was forgot in the commits somewhere

@szmarczak
Copy link
Collaborator

Actually it never made to Got 11, but is fixed in Got 12: ff918fb

@szmarczak
Copy link
Collaborator

Duplicate of #1540

@szmarczak szmarczak marked this as a duplicate of #1540 Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants