Cannot read property 'setTranslateX' of undefined when using expose-aside-when


#1

Hi all,

I’ve encountered an issue when Im trying to expose my right menu on a bigger screen.
After including the tag option into my tag, there is an error thrown as shown below:

TypeError: Cannot read property ‘setTranslateX’ of undefined
at self.openAmount (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:40190:17)
at self.openPercentage (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:40149:12)
at self.close (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:40105:10)
at self.exposeAside (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:40282:10)
at checkAsideExpose (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:41131:22)
at link (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:41146:7)
at nodeLinkFn (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:14336:13)
at compositeLinkFn (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:13730:13)
at nodeLinkFn (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:14330:24)
at compositeLinkFn (http://127.0.0.1:51111/www/lib/ionic/js/ionic.bundle.js:13730:13) ionic.bundle.js:17696

What could be a possible solution for this issue, hope I can fix this issue soon :smiley:

Thank you :slight_smile:


#2

Hey there! You’ve likely solved your issue by now - leaving this for posterity:

Make sure that your ion-side-menu directives follow your ion-side-menu-content directive, like so (using Jade syntax):

ion-side-menus
	ion-side-menu-content
		ion-nav-bar
		ion-nav-view
	ion-side-menu(side="left" expose-aside-when="large")
		h1 I'm the left side-menu!
	ion-side-menu(side="right" expose-aside-when="large")
		h1 I'm the right side-menu!

Placing an ion-side-menu prior to the ion-side-menu-content directive will cause the error you saw. Hope this helps!


#3

Hi Ryan,

Thank you so much for your reply.
I will try out the solution and let you know again :smile:

Update:
I think i have the same structure format that you propose… I tried moving the sidemenu content before ion-side-menu too… it still happens :slight_smile:

Regards
Reiji