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.

[BUG] Unable start `TypeError: Cannot read properties of null (reading 'includes')`

See original GitHub issue

Describe the bug Can`t start youtubedl-m due error includes null

2022-05-05T08:58:55.945Z INFO: Config items set using ENV variables.
/home/debian/youtubedl-material/youtube-dl.js:93
    if (!is_windows && details_json && details_json['path'].includes('.exe')) {
                                                            ^

TypeError: Cannot read properties of null (reading 'includes')
    at Object.exports.verifyBinaryExistsLinux (/home/debian/youtubedl-material/youtube-dl.js:93:61)
    at startYoutubeDL (/home/debian/youtubedl-material/app.js:671:19)
    at loadConfig (/home/debian/youtubedl-material/app.js:514:11)
    at async setAndLoadConfig (/home/debian/youtubedl-material/app.js:483:5)

I see the PR about checking binary of youtube-dl, seems it solve some weird behaviour thinking run windows? and no .exe extension here. Full path will be node_modules/youtube-dl/bin/youtube-dl

To Reproduce Steps to reproduce the behavior:

  1. Follow install guide
  2. node ./app.js

Expected behavior Application should start

Screenshots

Environment

  • YoutubeDL-Material git master
  • Dockerized nodejs 16 self build

Youtube-dl version Youtube-dl itself installed by NPM correctly with version 2021.12.17

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Tzahi12345commented, May 5, 2022

@GlassedSilver no need to overcomplicate it! We can just check if the path is null and handle that case. More ideally we should check all necessary fields to make sure they’re set properly.

I actually expected the details file to be more mangled than this. The hotfix will prevent the error from coming up but I’ll make a more permanent solution that handles more edge cases. Thanks for the info @martadinata666!

1reaction
martadinata666commented, May 5, 2022

Technically, yes it works. But can’t really tell specific situation like #601 , as i myself build for my arm64 and not encountering something like that. Maybe some node 12 quirk. I will send PR to test nodejs upgrade.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
TypeError: Cannot read properties of null (reading 'user')
Initially, in the first render, user state has a value null and thus user cant have a property. WHat you can do to...
Read more >
TypeError: Cannot read property 'includes' of Null in JS
The "Cannot read property 'includes' of null" error occurs when the `includes()` method is called on a variable that stores a `null` value....
Read more >
Cannot read properties of null (reading 'contains')error in react ...
TypeError : Cannot read properties of null ( reading ' contains '), Need useEffect Cleanup,EventBubblingtypeerror cannot read property of null ...
Read more >
Creating comment failed: TypeError: Cannot read properties of ...
Issue a comment for repo B; will fail and not be saved. Works once you restart Vscode and edit the PR of B...
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