Error: Could not find module ... nativescript-telerik-ui-pro/listview


#1

I’ve been using nativescript-telerik-ui-pro and it’s working ok on my first project.

BUT, on any other projects, I get an error. It seems like it can’t find the framework.

Here are the steps to reproduce:

tns create bugDemo --tsc
cat package.json
{
“description”: “NativeScript Application”,
“license”: "SEE LICENSE IN ",
“readme”: “NativeScript Application”,
“repository”: “”,
“nativescript”: {
“id”: “org.nativescript.bugDemo”
},
“dependencies”: {
“nativescript-theme-core”: “~1.0.2”,
“tns-core-modules”: “rc”
},
“devDependencies”: {
“nativescript-dev-android-snapshot”: “^0..”,
“nativescript-dev-typescript”: “~0.4.0”,
“typescript”: “~2.2.1”
}
}

tns plugin add file:///Users/henriqueMac/Documents/Telerik/UiForNativeScript1.6.1.231/Packages/nativescript-ui-pro.tgz
Successfully installed plugin nativescript-telerik-ui-pro.

cat package.json
{
“description”: “NativeScript Application”,
“license”: "SEE LICENSE IN ",
“readme”: “NativeScript Application”,
“repository”: “”,
“nativescript”: {
“id”: “org.nativescript.bugDemo”
},
“dependencies”: {
“nativescript-telerik-ui-pro”: “file:///Users/henriqueMac/Documents/Telerik/UiForNativeScript1.6.1.231/Packages/nativescript-ui-pro.tgz”,
“nativescript-theme-core”: “~1.0.2”,
“tns-core-modules”: “rc”
},
“devDependencies”: {
“nativescript-dev-android-snapshot”: “^0..”,
“nativescript-dev-typescript”: “~0.4.0”,
“typescript”: “~2.2.1”
}
}

// ADD items array to main-view-model.ts

public items: Array;

// add next line to constructor:
this.items = [‘Item 1’, ‘Item 2’, ‘Item 3’]; // just for demo

// Add a RadListView to the xml, so main-page.xml is now:

<Page.actionBar>


</Page.actionBar>

<lv:RadListView row=“0” items="{{ items }}" selectionBehavior=“Press” itemSelected=“onItemSelected” class=“menuListView” id=“myOrderlistView”>
lv:RadListView.listViewLayout
<lv:ListViewLinearLayout scrollDirection=“Vertical”/>
</lv:RadListView.listViewLayout>
<lv:RadListView.itemTemplate class=“my-order-item-template”>



</lv:RadListView.itemTemplate>
</lv:RadListView>




tns build ios
tns run ios

ERROR: (this is on the simulator)
file:///app/tns_modules/tns-core-modules/ui/builder/builder.js:195:56: JS ERROR Error: Building UI from XML. @file:///app/main-page.xml:9:9

Module ‘/Users/henriqueMac/Library/Developer/CoreSimulator/Devices/F3C9E401-3616-4043-BA6F-F7CA64C63FDC/data/Containers/Bundle/Application/78BC69E6-E786-49FC-AA1A-3A75D30BBA69/bugDemo.app/app/nativescript-telerik-ui-pro/listview’ not found for element ‘nativescript-telerik-ui-pro/listview:RadListView’.
Could not find module ‘/Users/henriqueMac/Library/Developer/CoreSimulator/Devices/F3C9E401-3616-4043-BA6F-F7CA64C63FDC/data/Containers/Bundle/Application/78BC69E6-E786-49FC-AA1A-3A75D30BBA69/bugDemo.app/app/nativescript-telerik-ui-pro/listview’. Computed path ‘/Users/henriqueMac/Library/Developer/CoreSimulator/Devices/F3C9E401-3616-4043-BA6F-F7CA64C63FDC/data/Containers/Bundle/Application/78BC69E6-E786-49FC-AA1A-3A75D30BBA69/bugDemo.app/app/nativescript-telerik-ui-pro/listview’.Apr 25 11:47:08 Henriques-MacBook-Pro com.apple.CoreSimulator.SimDevice.F3C9E401-3616-4043-BA6F-F7CA64C63FDC.launchd_sim[80854] (UIKitApplication:org.nativescript.bugDemo[0x7325][20774]): Service exited due to Segmentation fault: 11

All UI for NativeScript pro works on the very first app I’ve added to, but not on any other ones.

Any ideas on what am I doing wrong?

Thank you!


#2

hi, on the first app where you have it working, what is your version of tns-core-modules and what version of the CLI are you using? Could there be a mismatch as I see here you are using ‘rc’ versions?


#3

Jen, thanks for the response. I had to use rc to make it work on Android, I was unable to build for Android, now it works on both.

tns info
All NativeScript components versions information
┌──────────────────┬────────────────────────┬────────────────┬───────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 3.0.0-2017-03-30-8487 │ 2.5.4 │ Up to date │
│ tns-core-modules │ 3.0.0-rc.2 │ 2.5.2 │ Up to date │
│ tns-android │ │ 2.5.0 │ Not installed │
│ tns-ios │ 3.0.0-rc.1-2017-3-28-2 │ 2.5.0 │ Up to date │
└──────────────────┴────────────────────────┴────────────────┴───────────────┘

The first app works fine. Then I clone (git clone), change the bindle identifier, and try to run the exact same app, package.json looks the same (except for the id), and the second app gets that error. Then, after trying several things, I start a brand new app, add the telerik-ui-pro, add the radListView and minimum code and still get same error.


#4

Jen, I’ve figured out! Thank you for your response!


#5

@henrique1977
How you solved out issue…??
I am facing similar problem…

Native stack trace:
2017-06-16 17:58:59.196462+0200 Hieber[2117:678694] 1   0x100d76068 -[TNSRuntime executeModule:referredBy:]
1   0x100d76068 -[TNSRuntime executeModule:referredBy:]
2017-06-16 17:58:59.198974+0200 Hieber[2117:678694] 2   0x100064cb0 main
2   0x100064cb0 main
2017-06-16 17:58:59.199002+0200 Hieber[2117:678694] 3   0x190a7159c <redacted>
3   0x190a7159c <redacted>
JavaScript stack trace:
1   @file:///app/tns_modules/nativescript-imagepicker/images.js:8:25
JavaScript error:
2017-06-16 17:58:59.199080+0200 Hieber[2117:678694] file:///app/tns_modules/nativescript-imagepicker/images.js:8:25: JS ERROR Error: Could not find module 'nativescript-telerik-ui/listview'. Computed path '/var/containers/Bundle/Application/02B132CA-D1AE-4467-ABC1-AF58F14568C7/Hieber.app/app/tns_modules/nativescript-telerik-ui/listview'.

file:///app/tns_modules/nativescript-imagepicker/images.js:8:25: JS ERROR Error: Could not find module 'nativescript-telerik-ui/listview'. Computed path '/var/containers/Bundle/Application/02B132CA-D1AE-4467-ABC1-AF58F14568C7/Hieber.app/app/tns_modules/nativescript-telerik-ui/listview'.
(lldb)