-
Notifications
You must be signed in to change notification settings - Fork 412
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
TypeError: Cannot read property 'length' of undefined when using steps #163
Comments
That looks like a bug... I will look into it during the weekend. Thanks. |
I tried it, but it works well here. Could you create a minimal app that has the problem, so I could try reproduce it? |
Thanks for checking. I tried creating a whole new app with similar setup and didn't have luck reproducing it in that app yet. I will dive into it more tomorrow and hopefully reproduce it or figure out what's wrong in my main app. |
Please, let me know what is the problem even if it is in your own app: it might be worth a warning in the doc, helping other users to avoid it. |
I was able to reproduce it. It has to do with the Rails link_to and probably turbolinks? This app is setup with a home page with a link to a index page and then a link back to the home page. There is a seed to seed it with some test data. If you click the link to go to the index page, and then click the link to go back to the home page, and then resize the window, the errors start flowing. If you don' use the link and just type the localhost URL or use your browser bookmark to go back to the home page, no errors. |
That's a very useful app and analysis. I will look into that ASAP. Thank you! |
@mulder-brewing please, try the |
Awesome, no more errors! Thanks so much! |
I am using the steps, which is working great. The problem is when I navigate from a index page which has a list of things with many pages and go to say a static page like my home page, and resize the window, I'm getting a ton of errors in the console and they won't stop coming until I navigate to a page other than my Rails app. It seems like the window listener is still trying to fire on the page resizing and it doesn't like that there's no pagy on the static page. If there's something I can be doing differently, please let me know.
Pagy::VARS[:steps] = { 0 => [1,0,0,1], 540 => [1,2,2,1], 720 => [1,4,4,1], 992 => [1,7,7,1], 1200 => [1,9,9,1], 1400 => [1,11,11,1], 1600 => [1,13,13,1], 1800 => [1,15,15,1], 1900 => [1,17,17,1] }
The text was updated successfully, but these errors were encountered: