Hello
I developing an application ... and using NativeScript UI pro to implement a RadListView
So my app info
<GridLayout tkExampleTitle tkToggleNavButton>
<RadListView [items]="dataItems">
<ng-template tkListItemTemplate let-item="item">
<StackLayout orientation="vertical">
<Label class="h3" [text]="item.firstName"></Label>
<Label class="h4" [text]="item.lastName"></Label>
</StackLayout>
</ng-template>
</RadListView>
</GridLayout>
I declared in myComponent.ts
`private _dataItems: ObservableArray
ngOnInit() {
this._dataItems = new ObservableArray(DATAITEMS);
}
get dataItems(): ObservableArray
return this._dataItems;
}
//out the calss
export var DATAITEMS: any[] = [
{ "id": 1, "name": "Item 1", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 2, "name": "Item 2", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 3, "name": "Item 3", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 4, "name": "Item 4", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 5, "name": "Item 5", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 6, "name": "Item 6", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 7, "name": "Item 7", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 8, "name": "Item 8", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 9, "name": "Item 9", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image", "selected": false },
{ "id": 10, "name": "Item 10", "description": "This is item description.", "title": "This is item Title", "text": "This is item Text", "image": "This is item Image" , "selected": false},
]`
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'extend' of undefined
TypeError: Cannot read property 'extend' of undefined
at __extends (/data/data/org.nativescript.ElectionsMob/files/internal/ts_helpers.js:50:13)
at file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-pro-ui/listview/listview.js:73:9
at ensureListViewAdapter (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-pro-ui/listview/listview.js:234:6)
at new RadListView (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-pro-ui/listview/listview.js:242:9)
at ViewUtil.createView (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-angular/view-util.js:202:20)
at NativeScriptRenderer.createElement (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-angular/renderer.js:109:30)
at DebugRenderer2.createElement (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:15187:49)
at createElement (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:10560:27)
at createViewNodes (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:13725:61)
at callViewAction (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:14198:13)
at execComponentViewsAction (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:14107:13)
at createViewNodes (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:13792:5)
at createRootView (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:13653:5)
at callWithDebugContext (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:15078:42)
at Object.debugCreateRootView [as createRootView] (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/core/bundles/core.umd.js:14361:12)
ERROR Error: Uncaught (in promise): Error: Outlet is not activated
Error: Outlet is not activated
at PageRouterOutlet.detach (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-angular/router/page-router-outlet.js:190:19) [angular]
at ActivateRoutes.detachAndStoreRouteSubtree (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5681:64) [angular]
at ActivateRoutes.deactivateRouteAndItsChildren (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5662:18) [angular]
at ActivateRoutes.deactivateRoutes (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5646:22) [angular]
at file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5606:19 [angular]
at Array.forEach (native) [angular]
at ActivateRoutes.deactivateChildRoutes (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5604:29) [angular]
at ActivateRoutes.activate (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5584:14) [angular]
at file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5499:22 [angular]
at SafeSubscriber._next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Observable.js:225:21) [angular]
at SafeSubscriber.__tryOrSetError (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:248:16) [angular]
at SafeSubscriber.next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:188:27) [angular]
at Subscriber._next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:126:26) [angular]
at Subscriber.next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:90:18) [angular]
13:01:41.511 ERROR Error: Uncaught (in promise): Error: Outlet is not activated
Error: Outlet is not activated
at PageRouterOutlet.detach (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/nativescript-angular/router/page-router-outlet.js:190:19) [angular]
at ActivateRoutes.detachAndStoreRouteSubtree (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5681:64) [angular]
at ActivateRoutes.deactivateRouteAndItsChildren (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5662:18) [angular]
at ActivateRoutes.deactivateRoutes (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5646:22) [angular]
at file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5606:19 [angular]
at Array.forEach (native) [angular]
at ActivateRoutes.deactivateChildRoutes (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5604:29) [angular]
at ActivateRoutes.activate (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5584:14) [angular]
at file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/@angular/router/bundles/router.umd.js:5499:22 [angular]
at SafeSubscriber._next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Observable.js:225:21) [angular]
at SafeSubscriber.__tryOrSetError (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:248:16) [angular]
at SafeSubscriber.next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:188:27) [angular]
at Subscriber._next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:126:26) [angular]
at Subscriber.next (file:///data/data/org.nativescript.ElectionsMob/files/app/tns_modules/rxjs/Subscriber.js:90:18) [angular]
I Just install a new Project and moved my code
it is worked new
I guess, after you install a new TNS plugin (such as RadListView), it is recommended to delete the "platforms" folder and rebuild the entire project. I encountered this issue too and this was my solution to the problem.
@92Arbiter That is exactly the solution! 馃拑
@92Arbiter Thank you :)
Have same problem here (I guess). Uncountable rebuilds. tns build android --clean build successfully, but tns run android --bundle throws error after app refresh:
System.err: TypeError: Cannot read property 'extend' of undefined
System.err: File: "<unknown>, line: 1, column: 265
System.err:
System.err: StackTrace:
System.err: Frame: function:'__extends', file:'/data/data/br.myapp/files/internal/ts_helpers.js', line: 63, column: 14
System.err: Frame: function:'', file:'file:///data/data/br.myapp/files/app/vendor.js', line: 138708, column: 5
System.err: Frame: function:'../node_modules/nativescript-ui-sidedrawer/ui-sidedrawer.common.js', file:'file:///data/data/br.myapp/files/app/vendor.js', line: 138884, column: 2
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/br.myapp/files/app/bundle.js', line: 76, column: 30
System.err: Frame: function:'../node_modules/nativescript-ui-sidedrawer/ui-sidedrawer.js', file:'file:///data/data/br.myapp/files/app/vendor.js', line: 138905, column: 10
System.err: Frame: function:'__webpack_require__', file:'file:///data/data/br.myapp/files/app/bundle.js', line: 76, column: 30
...
Using the new deps:
"nativescript-ui-listview": "^3.8.0",
"nativescript-ui-sidedrawer": "^5.0.0",
Windows environment.
removing node_modules didn't work. but removing platforms does.
Most helpful comment
I guess, after you install a new TNS plugin (such as RadListView), it is recommended to delete the "platforms" folder and rebuild the entire project. I encountered this issue too and this was my solution to the problem.