Tns run android --bundle fails with element not found


#1

Hello Team,

My application runs fine when I run using tns run android but when I use tns run android --bundle then it gives me following exception.

‘nativescript-ui-sidedrawer’ not found for element 'nativescript-ui-sidedrawer:RadSideDrawer

I see following plugin requirement mentioned in my bundle-config.js.

global.registerModule("nativescript-ui-sidedrawer",
        () => require("../node_modules/nativescript-ui-sidedrawer"));

Can someone please help me how to deal with this?

Thanks,
Rakesh


#2

You are not supposed to use absolute path, node_module folder will not be packaged while building, so just try “nativescript-ui-sidedrawer”.


#3

tried changing to following but still got same error message:

global.registerModule("nativescript-ui-sidedrawer",
        () => require("../nativescript-ui-sidedrawer"));

global.registerModule("nativescript-ui-sidedrawer",
        () => require("./nativescript-ui-sidedrawer"));

But got same error.


#4

It should not be relative path, just use “nativescript-ui-sidedrawer”.


#5

Sorry I forgot to mention that I tried with just nativescript-ui-sidedrawer as well but no luck.