question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'contents' of undefined

See original GitHub issue

I got the error when start fetching the chat. It says…

(node:2864) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'contents' of undefined
    at LiveChat.fetchChat (webpack:///./node_modules/youtube-chat/dist/live-chat.js?:50:34)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:2864) 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: 18)

I don’t know what part is the content means. Any suggestions?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
KarasuTatehicommented, Feb 11, 2021

Note: This message has been translated by DeepL.

On January 29, YouTube seems to have changed the URL used for JSON retrieval to https://www.youtube.com/youtubei/v1/live_chat/get_live_chat?key={innertubeApiKey}.

You need to find the innertubeApiKey in the source code of the delivery page you are playing. It does not appear to be possible to retrieve the JSON in one step currently.

Source (Japanese) : https://qiita.com/pasta04/items/ec7ed6ded14d5af1663e

There is a great fork at IcedCoffeee/youtube-chat@3e20049 that may have fixed this problem. I’ve used it with the NodeCG bundle and it seems to work fine. Thanks IcedCoffeee!

0reactions
neverclear86commented, Nov 22, 2021

It will be closed as it will be supported by version 2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'forEach' of undefined - Stack ...
When you await an function like you do with getAddressFromDB, that function needs to return a promise. In your code, you are returning ......
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
(node:8003) UnhandledPromiseRejectionWarning: TypeError ...
I've got here with the same error after removing one npm package. The UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined ...
Read more >
Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError - Cannot read property 'then' of undefined is thrown when the caller is expecting a Promise to be returned and instead receives ......
Read more >
How To Fix Cannot read Property '0' of Undefined in JS
To resolve your TypeError: Cannot read properties of undefined (reading '0') , go through these steps: Ensure you are using the correct ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found