Hi,
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 :
resize:function({this.setDimensions(this.__container.clientWidth,this.__container.clientHeight,this.options.getContentWidth(),this.options.getContentHeight())}
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)
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.
Thanks.
Just in case it helps, also happening here, $element is null:
Ok I have a codepen link that shows the issue http://codepen.io/anon/pen/eAcHq
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 http://codepen.io/anon/pen/dKvmH
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
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.
Hi,
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.