Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

TypeError: filterWrapper is not iterable #180

Open
abaza738 opened this issue Feb 7, 2023 · 9 comments
Open

TypeError: filterWrapper is not iterable #180

abaza738 opened this issue Feb 7, 2023 · 9 comments

Comments

@abaza738
Copy link

abaza738 commented Feb 7, 2023

Error

/<project_dir>/node_modules/ytsr/lib/utils.js:23
  for (const filterGroup of filterWrapper) {
                            ^

TypeError: filterWrapper is not iterable
    at Object.exports.parseFilters (/<project_dir>/node_modules/ytsr/lib/utils.js:23:29)
    at module.exports (/<project_dir>/node_modules/ytsr/lib/main.js:60:24)
    at runMicrotasks (<anonymous>)
    ...

Details

For some reason, the value of searchSubMenuRenderer is sometimes returned as this:

{
  "trackingParams": "CDIQkXUiEwjSt4yGr4T9AhU2O_EFHQmlCT8="
}

Hence filterWrapper is undefined.

@eugabrielsilva
Copy link

Same error! Waiting for a fix, since this lib is the main tool used in my application... @TimeForANinja

@ArmyaAli
Copy link

ArmyaAli commented Apr 7, 2023

I'm having this issue as well. This occurs so randomly as well

@TimeForANinja
Copy link
Owner

can you try changing filterWrapper to sth like

- const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups;
+ const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups || [];

can't recreate the error myself...

@abaza738
Copy link
Author

I guess I can submit a PR with that change, but I don't have any knowledge of what the code does in there.

@dev-syn
Copy link

dev-syn commented Jun 3, 2023

I also have this issue now and then it just randomly occurs like when I try searching for various songs some fail and then when I try again it works I can't reproduce it every time

@AaronMeyers
Copy link

i’m also having this issue

@dafatov
Copy link
Contributor

dafatov commented Jun 24, 2023

Created a PR related to this defect. See plz. @TimeForANinja
#203

@BrijeshNenwani
Copy link

BrijeshNenwani commented Jul 28, 2023

Earlier, It was failing 4 out of 5 times, and now it doesn't fail at all, thank you for this 👉#180 (comment)
BTW, your library serves one of the major feature in my application, and its awesome.
Note: This was my first comment on github.

@NotYuzuru
Copy link

can you try changing filterWrapper to sth like

- const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups;
+ const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups || [];

can't recreate the error myself...

this worked indeed, thanks!

TubaApollo added a commit to TubaApollo/eggs that referenced this issue Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants