/ / Error: el componentRef actual es diferente para el componentRef en caché - angular, angular2-nativescript

Error: el componenteRef actual es diferente para el componente en memoria cachéRef - angular, angular2-nativescript

Estoy desarrollando una aplicación NativeScript Angular 2.

Tengo un ListView que contiene un montón deobjetos. Al tocar uno de estos objetos se abre un nuevo componente. Después de presionar el botón Atrás para volver a la lista y presionar otro objeto de la lista, aparece el siguiente error:

¿Cómo puedo arreglar esto?

CONSOLE ERROR file:///app/tns_modules/@angular/core/./bundles/core.umd.js:1091:24: ERROR Error: Uncaught (in promise): Error: Current componentRef is different for cached componentRef
deactivate@file:///app/tns_modules/nativescript-angular/router/page-router-outlet.js:105:32 [angular]
deactiveRouteAndOutlet@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4578:30 [angular]
deactiveRouteAndItsChildren@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4538:40 [angular]
deactivateRoutes@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4467:49 [angular]
file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4429:35 [angular]
forEach@[native code] [angular]
deactivateChildRoutes@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4428:36 [angular]
activate@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4415:35 [angular]
file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4034:30 [angular]
file:///app/tns_modules/rxjs/Observable.js:110:25 [angular]
__tryOrSetError@file:///app/tns_modules/rxjs/Subscriber.js:247:20 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:187:42 [angular]
_next@file:///app/tns_modules/rxjs/Subscriber.js:125:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:143:34 [angular]
_next@file:///app/tns_modules/rxjs/InnerSubscriber.js:23:31 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_subscribe@file:///app/tns_modules/rxjs/observable/ScalarObservable.js:49:28 [angular]
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:57:35 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:45:40 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
_innerSub@file:///app/tns_modules/rxjs/operator/mergeMap.js:130:55 [angular]
_tryNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:127:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/mergeMap.js:110:26 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:143:34 [angular]
_next@file:///app/tns_modules/rxjs/InnerSubscriber.js:23:31 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_complete@file:///app/tns_modules/rxjs/operator/reduce.js:119:34 [angular]
complete@file:///app/tns_modules/rxjs/Subscriber.js:114:27 [angular]
_complete@file:///app/tns_modules/rxjs/operator/mergeMap.js:135:38 [angular]
complete@file:///app/tns_modules/rxjs/Subscriber.js:114:27 [angular]
_subscribe@file:///app/tns_modules/rxjs/observable/ArrayObservable.js:116:32 [angular]
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:57:35 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:45:40 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
_innerSub@file:///app/tns_modules/rxjs/operator/mergeMap.js:130:55 [angular]
_tryNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:127:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/mergeMap.js:110:26 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:143:34 [angular]
_next@file:///app/tns_modules/rxjs/InnerSubscriber.js:23:31 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:143:34 [angular]
_next@file:///app/tns_modules/rxjs/InnerSubscriber.js:23:31 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyComplete@file:///app/tns_modules/rxjs/operator/every.js:53:30 [angular]
_complete@file:///app/tns_modules/rxjs/operator/every.js:70:28 [angular]
complete@file:///app/tns_modules/rxjs/Subscriber.js:114:27 [angular]
_complete@file:///app/tns_modules/rxjs/operator/mergeMap.js:135:38 [angular]
complete@file:///app/tns_modules/rxjs/Subscriber.js:114:27 [angular]
_subscribe@file:///app/tns_modules/rxjs/observable/ArrayObservable.js:116:32 [angular]
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:57:35 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:45:40 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
_innerSub@file:///app/tns_modules/rxjs/operator/mergeMap.js:130:55 [angular]
_tryNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:127:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/mergeMap.js:110:26 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyComplete@file:///app/tns_modules/rxjs/operator/every.js:53:30 [angular]
_complete@file:///app/tns_modules/rxjs/operator/every.js:70:28 [angular]
complete@file:///app/tns_modules/rxjs/Subscriber.js:114:27 [angular]
_complete@file:///app/tns_modules/rxjs/operator/mergeMap.js:135:38 [angular]
complete@file:///app/tns_modules/rxjs/Subscriber.js:114:27 [angular]
_subscribe@file:///app/tns_modules/rxjs/observable/ArrayObservable.js:116:32 [angular]
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:57:35 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:45:40 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
_innerSub@file:///app/tns_modules/rxjs/operator/mergeMap.js:130:55 [angular]
_tryNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:127:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/mergeMap.js:110:26 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:143:34 [angular]
_next@file:///app/tns_modules/rxjs/InnerSubscriber.js:23:31 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_subscribe@file:///app/tns_modules/rxjs/observable/ScalarObservable.js:49:28 [angular]
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:57:35 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:45:40 [angular]
subscribe@file:///app/tns_modules/rxjs/Observable.js:42:26 [angular]
_innerSub@file:///app/tns_modules/rxjs/operator/mergeMap.js:130:55 [angular]
_tryNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:127:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/mergeMap.js:110:26 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
notifyNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:143:34 [angular]
_next@file:///app/tns_modules/rxjs/InnerSubscriber.js:23:31 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30 [angular]
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23 [angular]
_subscribe@file:///app/tns_modules/rxjs/observable/ScalarObservable.js:49:28 [angular]

`` `

Respuestas

2 para la respuesta № 1

Recibí este error porque la página de detalles hacía referencia a una propiedad de objeto en la barra de acción ... (parece que no se creó una instancia en el momento en que se procesó la barra de acción) Espero que ayude


0 para la respuesta № 2

Acabo de agregar un * ngIf en mi atributo para verificar que no está indefinido.

Ejemplo:

<StackLayout *ngIf="example">
<Label textWrap="true" [text]="example.title"></Label>
<Image [src]="example.image" height="100"></Image>
</StackLayout>