SideDrawer not working on version 4.x


Does anybody has any ideas, why this plugin is not working after update from 3.5->4.0?
I cant find any breaking changes.
Maybe, i don’t have some dependencies ?
I have no idea.

My simple javascript that worked prevoiusly is:

var frame = require('ui/frame');
var LS = require("nativescript-localstorage");

exports.toggleDrawer = function () {

    var menu = frame.topmost().getViewById("openMenu");

drawer = frame.topmost().getViewById(“sideDrawer”);

if (menu.classList.contains('hidden')) {
} else {


Thanks for any help.


Can you please be more specific what exactly is not working, I can confirm SideDrawer works in my apps running in 4.x


Hi @manojdcoder,
The error is :
file:///app/tns_modules/nativescript-ui-sidedrawer/ui-sidedrawer.js:228:29: JS ERROR TypeError: undefined is not an object (evaluating ‘this.mainContent.layout’)


Were you able to reproduce the issue in Playground?


I’ve never use this, maybe it’s time to start.
But just to be sure, i don’t import anything (require) regarding sidedrawer.
On 3.5.1 all is ok, but upgrading to 4.x makes this issue.
Downgrading works well…


Sorry, without seeing an example where the issue could be reproduced I’m unable to give any directions.

But I’m sure it works with 4.x, you may even checkout the drawer starter template.


Can yo share a like for this ? Thank you !


I followed this guide to get my side drawer working.

You can also try deleting the platforms folder in the root to force a complete rebuild.