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

Cannot read property 'page' of undefined, #34

Closed
KR0WLEY opened this issue Aug 11, 2019 · 5 comments
Closed

Cannot read property 'page' of undefined, #34

KR0WLEY opened this issue Aug 11, 2019 · 5 comments
Assignees
Labels

Comments

@KR0WLEY
Copy link

KR0WLEY commented Aug 11, 2019

Code: https://pastr.io/view/1NNYwx Error: https://i.imgur.com/wtCG640.png

@AtoraSuunva
Copy link
Owner

Seems to be due to how I made SearchResults act like an array, it calls the constructor with the wrong arguments.

I'll see how I can work around this without needing to just re-implement every array function.

@AtoraSuunva AtoraSuunva self-assigned this Aug 15, 2019
@KR0WLEY
Copy link
Author

KR0WLEY commented Aug 18, 2019

The error started when I made the filter. const images = i.filter(img => img.data.rating === 'e')

@nfearnley
Copy link

Any progress on this? I found the same issue with the results.map().

@AtoraSuunva
Copy link
Owner

With how busy I've been, this issue kinda dropped from my todo list.

I'll try and have a fix out this weekend

@AtoraSuunva AtoraSuunva mentioned this issue Dec 16, 2019
AtoraSuunva pushed a commit that referenced this issue Dec 16, 2019
@AtoraSuunva
Copy link
Owner

Fixed in booru@2.0.4

The workaround itself is somewhat hacky, but should work fine.

Only downside is that calling array methods on SearchResults returns an array of Posts, meaning you lose all the SearchResults methods (although that shouldn't be a problem?)

#37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants