Ionic and angularjs Cannot read property 'scrollWidth' of null

I have the following problem. I have two exactly the same list views, with directives inside (I use angularJS). One of them runs without any issues, however the other one throws the following error:

TypeError: Cannot read property ‘scrollWidth’ of null
at Object.ionic.views.Scroll.ionic.views.View.inherit.initialize.options.getContentWidth (ionic.bundle.js:4081)
at ionic.views.Scroll.ionic.views.View.inherit.resize (ionic.bundle.js:4835)
at (ionic.bundle.js:4147)
at ionic.bundle.js:39888
at ionic.bundle.js:21929
at completeOutstandingRequest (ionic.bundle.js:12022)
at ionic.bundle.js:12330ionic.bundle.js:17696 (anonymous function)ionic.bundle.js:14989 $getionic.bundle.js:21932 (anonymous function)ionic.bundle.js:12022 completeOutstandingRequestionic.bundle.js:12330 (anonymous function)

My code is pretty long, so I am not posting it yet - if there is need to do so, I will :slight_smile:

HINT: I’ve tested the app on my phone, and it seems that I cant scroll on which the error occurs. Any suggestions?


Alright, I made a pretty simply error: i didn’t included any div inside my ion-scroll. This fixed my problem.