Bug with ionic 1.0.0 beta7


#1

The bug is detected from the console when running the app on my device. Everything is fine in a desktop-browser

In fact, the bug was once reported at Maybe a trivial bug with ionic 1.0.0-beta.5.
But it was fixed in the nightly build later.

However it re-appears in beta.7 and beta.6:
ionic.js: Line 6108 : Uncaught TypeError: Cannot read property ‘width’ of null

Meanwhile, in beta.7 there is an extra console message about angularjs (1.2.17):
angular.js: Line 9899 : TypeError: undefined is not a function

And the last error totally disabled my app, as my app stops showing even the first view on my android device.


#2

Looking at the link in the other forum post it seems your issue couldn’t be reproduced. But it was fixed somehow. Could you take a look at the Github issues list and see if your issue was fixed between beta 5 and beta 6, and if so, which one was it?


#3

I have the same issue with Beta6, don’t recall having it with Beta5.


#4

I have not reported the issue at Github.
But yes, after I post the issue here,
@mhartington pointed to me that I should upgrade to the night build.
And then I found that it was fixed at some time.

However, just a few days ago I tried to test my app on the device,
I found the issue again on beta 6, and then beta 7.

So I did not know which one fixed the issue.
Compared to this trivial issue, I am now in fact more concerned with the angular issue.
It disabled me totally to test my app on the device.


#5

Be sure that you are using the non-minified version of the ionic files so you get a proper error. Then could you post the full stacktrace of the error?

I’m not sure it’s an Ionic error, it may be a problem in your code.


#6

Using the starter sidemenu project, generated by the Ionic CLI:
D/CordovaLog(12716): file:///android_asset/www/lib/ionic/js/ionic.bundle.js: Line 6115 : Uncaught TypeError: Cannot read property ‘width’ of null

ionic.bundle.js::
6073ionic.views.HeaderBar = ionic.views.View.inherit({
6084align: function(align) {
6096ionic.requestAnimationFrame(function() {
6115childSize = ionic.DomUtil.getTextBounds(c).width;

This has happened for a long time now, and it seems to disable title alignment other than center on androids lower than 4.4.


#7

@fredericogalvao gave me a good hint how to re-produce the issue.
Here are the steps

  1. sudo npm install -g ionic
  2. ionic start test-ionic (this will create the default tab project)
  3. cd test-ionic
  4. ionic platform add android
  5. ionic run android (this will install the app on the device)
  6. adb logcat CordovaLog:D *:S (run it in another term to listen to the device)

It will show you exactly what @fredericogalvao has reported. It is a trivial issue as I have said, you can still use the app.

Now if you switch to “Friends” tab in the app, and click any item, the view will be stucked there, and you will get what I have reported earilier (a little different in text, but I guess it is the sample problem about angular-animation):

D/CordovaLog( 6868): file:///android_asset/www/lib/ionic/js/ionic.bundle.js: Line 18890 : TypeError: undefined is not a function
D/CordovaLog( 6868):     at CALL_NON_FUNCTION (native)
D/CordovaLog( 6868):     at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:20688:13
D/CordovaLog( 6868):     at afterReflow (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:31783:11)
D/CordovaLog( 6868):     at animate (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:32160:9)
D/CordovaLog( 6868):     at Object.fn (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:32189:18)
D/CordovaLog( 6868):     at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:31132:46
D/CordovaLog( 6868):     at Array.forEach (native)
D/CordovaLog( 6868):     at forEach (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:9311:11)
D/CordovaLog( 6868):     at run (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:31117:11)
D/CordovaLog( 6868):     at Object.after (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:31157:13)

The text above is shown 3 times in the concole.
@fredericogalvao please give it a try in your siemenu project to see if you get the same result.


cancelAnimationFrame error Samsung M style android os 2.3.3
#8

@zwz Looks like we’re talking about 2 different things in here. I commented on both yesterday, and I don’t think they’re related to one another…

One is the width thing, that has been present since beta.2 I think. The other one is the undefined is not a function, that I explained in details here. Now, thank you because you’ve just provided the test case that @andy asked for to reproduce that bug.

As for the bug mentioned in this thread, any of the starter projects generated by ionic will sufice.


#9

OK, thanks @fredericogalvao and @zwz . We will fix the header bug, revert to 1.2.12 again for now, and release beta.7b on Monday.


#10

@fredericogalvao Yes, I mentioned 2 things in one post. I should mention them separately, but at that time I did not know how to describe them clear and exact at all.
Thank you for sharing the thread.


#11

Nice. Ionic is great. :slight_smile:

Thank you guys.


#12

@andy there is the link to a github ‘width’ issue discussed above that I created few weeks ago:


#13

@zwz @fredericogalvao

Have you already try beta 8? I have the same problem error at line 6115
after update to new beta, no more error but still nothing render in content (only side-menu and header)


#14

With nightly build, everything seems fine here.


#15

@birdmwit18 Yes I’m already using beta.8 and it hasn’t failed on me yet. However, I haven’t checked the logs on the older android devices yet as they’re not available at this exact moment to me. I’ll do later today and post again if I find any errors.


#16

Works fine now
It’s my fault with layout coding.
So embarrassing :smiley: .