IONIC beta 12 strange error


I am getting error since i have upgraded my app to ionic beta 12.

Below is the error message and stack trace :

Error Message : TypeError: Cannot read property ‘clientWidth’ of undefined

Error StackTrace : TypeError: Cannot read property ‘clientWidth’ of undefined, at e.views.Scroll.e.views.View.inherit.resize (file:///android_asset/www/lib/ionic-1.0.0-beta.12/ionic.bundle.min.js:23:16312), at file:///android_asset/www/lib/ionic-1.0.0-beta.12/ionic.bundle.min.js:45:168, at file:///android_asset/www/lib/ionic-1.0.0-beta.12/ionic.bundle.min.js:152:445, at e (file:///android_asset/www/lib/ionic-1.0.0-beta.12/ionic.bundle.min.js:68:440), at file:///android_asset/www/lib/ionic-1.0.0-beta.12/ionic.bundle.min.js:72:120

This error occurs randomly any time, hard to replicate every time.

Page on which this error occurs uses Ionic Slidebox.

Place where this error occurs is :

Can you tell me what’s causing it?


I am getting so many of these :frowning:


Hmm, could you produce a codepen demo that has this error too?


Has it got anything to do with opening a Modal?
Have a look and see if you’ve got multiple events occuring.
I was having this issue when an a tag had an ng-click for a modal, i.e.

<a href="#" ng-click="openModal()"</a>

If you remove the hash, everything works as no transition occurs.
Hope that helps.


Hi, I’m having the same error, somewhere during bootstrapping.

TypeError: Cannot read property 'clientWidth' of undefined
    at ionic.views.Scroll.ionic.views.View.inherit.resize (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:4801:23)
    at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:8616:18
    at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:21691:28
    at completeOutstandingRequest (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:11901:10)
    at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:12202:7 ionic.bundle.js:17470
(anonymous function)


We are having this error too. It happens when changing states.

Uncaught TypeError: Cannot read property 'clientWidth' of undefined (caused by "undefined") ionic.bundle.js:4801ionic.views.Scroll.ionic.views.View.inherit.resize ionic.bundle.js:4801val ionic.bundle.js:8616(anonymous function) ionic.bundle.js:21691completeOutstandingRequest ionic.bundle.js:11901(anonymous function)

scrollView is null:

$timeout(function() {;

Also if we do

$rootScope.$on('$stateChangeSuccess', function(){

Then this.__container in undefined

resize: function() {
// Update Scroller dimensions for changed content
// Add padding to bottom of content

Nothing of this happened in beta 11.

Any idea?


This should be fixed in the nightly builds everyone.
Can you all test it and confirm?


Update to nightly solves the issue, thanks


Still problems with scroll in nightly :frowning:

Uncaught TypeError: Cannot read property 'scrollTo' of null (caused by "undefined") (caused by "undefined") (caused by "undefined") ionic.bundle.js:39909(anonymous function) ionic.bundle.js:39909deferred.promise.then.wrappedCallback ionic.bundle.js:19197(anonymous function) ionic.bundle.js:19283$get.Scope.$eval ionic.bundle.js:20326$get.Scope.$digest ionic.bundle.js:20138$get.Scope.$apply ionic.bundle.js:20430(anonymous function) ionic.bundle.js:21938completeOutstandingRequest ionic.bundle.js:12022(anonymous function)

After changing states (not always, only in the one that takes you to the homepage and not always either) scrollView is undefined:

this.scrollTop = function(shouldAnimate) {
this.resize().then(function() {
  scrollView.scrollTo(0, 0, !!shouldAnimate);


We have an scrollTop on every state change start:

$rootScope.$on('$stateChangeStart', function(){


Could you provide a codepen showing this error @ruben?


hey @mhartington, sorry but I cannot provide it in a codepen as it’s happening in the application we are developing, not small and not in production yet. I tried to do a minimal version but then is not happening. For now I think we will just put the conditions to check if $scrollView or $element are defined and not null and do further investigation. Will update you if we manage to discover it.


Just in case it helps, also happening here, $element is null:

this.resize = function() {
return $timeout(resize).then(function() {



Uncaught TypeError: Cannot read property 'triggerHandler' of null (caused by "undefined") (caused by "undefined")   (caused by "undefined") ionic.bundle.js:39386 
(anonymous function) ionic.bundle.js:39386
wrappedCallback ionic.bundle.js:18984
(anonymous function) ionic.bundle.js:19070
Scope.$eval ionic.bundle.js:20094
Scope.$digest ionic.bundle.js:19906
Scope.$apply ionic.bundle.js:20198
(anonymous function) ionic.bundle.js:21705
completeOutstandingRequest ionic.bundle.js:11906
(anonymous function)


I’m also experiencing this behavior.

It appears to only happen in beta 12, but not the nightly build * Ionic, v1.0.0-beta.12-nightly-485

I can reproduce this when my app uses $state.go(‘some.thing’).

TypeError: Cannot read property ‘run’ of null
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:39362:15
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:21691:28
at completeOutstandingRequest (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11901:10)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:12202:7


Ok I have a codepen link that shows the issue
I am new to Ionic and dont understand it that well, this issue appears to happen when I have a tab with an href to a url outside the tabbed view. However It works fine if that tab is in the end of the tabs list, but does not work if it is anywhere else in the tab list. To elaborate, here is another code that shows signout working since it is in the end of the list

Hope this issue can be fixed soon.
Also if you create a custom button on the nav-bar and link it to signout page, the same error occurs.
TypeError: Cannot call method ‘run’ of null
I am using ionic 1.2.5


I am getting this exact same error. I’m running Ionic, v1.0.0-beta.13. I get the following:

Error: scrollView is null

This is happening when navigating back to home page. Any ideas what’s happening, or a fix?




Does you home view has an ion-content, ion-view or something special/ not “ionic-structure” like?


hey @tschreck, didn’t investigate too much this one. Just added a quick fix in ionic.bundle.js (1.0.0-beta.13)

Line 39910:

  this.scrollTop = function(shouldAnimate) {
    this.resize().then(function() {
      if(typeof scrollView !== 'undefined' && scrollView !== null){
        scrollView.scrollTo(0, 0, !!shouldAnimate);

And line 39813:

if (!angular.isDefined(scrollViewOptions.bouncing)) {
ionic.Platform.ready(function() {
  scrollView.options.bouncing = true;

  if(ionic.Platform.isAndroid()) {
    // No bouncing by default on Android
    scrollView.options.bouncing = false;
    // Faster scroll decel
    scrollView.options.deceleration = 0.95;
  } else {

The diff output:

diff ionic.bundle.wts.js ionic.bundle.js 
<       if(!scrollView){
<           return;
<       }
<       if(typeof scrollView !== 'undefined' && scrollView !== null){
<         scrollView.scrollTo(0, 0, !!shouldAnimate);
<       }
>       scrollView.scrollTo(0, 0, !!shouldAnimate);
< })();
> })();

Hope it helps


Yep. Here’s my code:

<ion-content class="has-header">
    <ion-list type="list-inset" can-swipe="{{ListCanSwipe}}">
        <div class="item item-divider">
            <div class="buttons">
                 <h3 class="title">My Turn {{MyTurnCountMessage}}</h3>
        <ion-item ng-repeat="game in MyTurnList" class="item-icon-left" item="item">
            <ion-option-button class="button-assertive">Delete</ion-option-button>

What should I do on the home page to not cause this error to happen?




Thanks for the reply. I did the exact same thing but in ionic-angular.js so I can get past this issue so I can continue development. I’m hoping ionic will have a patch soon. I do not like modifying code that will get overwritten on the next release of vendor code.



I occur the same issue. I found I set the ion-view hide-back-button=“true”, then add the backbutton by myself, the back button has the attr ui-sref=“someStatus”, when I click it, it will log the same error message.

But if I replace ui-sref with ng-click=“myGoBackMethod()”, then no error message. I don’t know why, hope it helps.


Just confirming that i have the same problem :frowning: no solution yet!