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

Error with lazyLoading in Version 1.2.3 #33

Open
dominikIncibit opened this issue Apr 20, 2016 · 6 comments
Open

Error with lazyLoading in Version 1.2.3 #33

dominikIncibit opened this issue Apr 20, 2016 · 6 comments

Comments

@dominikIncibit
Copy link

In the newest version (1.2.3) when lazy loading components (by using lazy-pages) whith iron-swipeables-pages the followign error occurs in iron-swipeable-pages.html on line 314:
Uncaught TypeError: Cannot read property 'offsetWidth' of undefined

@MeTaNoV MeTaNoV self-assigned this Apr 20, 2016
@MeTaNoV
Copy link
Collaborator

MeTaNoV commented Apr 20, 2016

Can you give me more detail about your setup? Since I don't have any lazy loading mechanism, how do you proceed? (My understanding is that currently, lazy-pages or iron-lazy-pages are replacement for iron-pages or neon-animated-pages

@dominikIncibit
Copy link
Author

I tried reproducing the issue but it seems to work just fine in this basic setup: http://jsbin.com/wedafevetu/2/edit?html,output

So it must be related to something else in my code (I also updated a bunch of components at once, maybe its the fault of another one). Unfortunately I'm not in office until some day next week and I dont have the code available here. I will give you an update as soon as possible.

@MeTaNoV
Copy link
Collaborator

MeTaNoV commented Apr 21, 2016

I see! No stress, I have other things to do meanwhile! :) Like set up a small working demo with carbon-route

@dominikIncibit
Copy link
Author

dominikIncibit commented Apr 25, 2016

How is your carbon-route demo going? :)

I just found out (at least partly) whats causing the issue. First of all it only happens when an Element containing iron-swipeable-pages takes really long to load. I am not sure why but this causes the code on line 201 to be executed:

_onDomChange: function(event) { if ( this.selectedItem && this.selectedItem.offsetWidth == 0 ) { this.selected = this.fallbackSelection; } },

However as the variable fallbackSelection isn't set (I can't even find it in the docu) its value is null and therefore selected is null which causes the exception. As a temporary workaround I just tried removing this code and everything works fine again. Nevertheless the if block should never even be entered in my opinion.

@MeTaNoV
Copy link
Collaborator

MeTaNoV commented Jun 24, 2016

@fleckdalm is it still an issue I should look at?

@dominikIncibit
Copy link
Author

Yes, please! I haven't tried your new versions as I haven't had any time but I had to fork your old version and remove this code in order to get it to work. It works perfectly fine for me this way :)

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

No branches or pull requests

2 participants