UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'contents' of undefined
See original GitHub issueI 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:
- Created 3 years ago
- Comments:9
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
innertubeApiKeyin 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.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!
It will be closed as it will be supported by version 2.