You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: Cannot reattach ActivatedRouteSnapshot with a different number of children #1830
The scenario which leads to the error: First the app starts with tabs route, then I go to the login page, after that I go to register and then again I go to tabs page (and clean the history). After that if I go to login page again and get back to previous one (tabs page), the error occurs.
The error:
JS: Error: Cannot reattach ActivatedRouteSnapshot with a different number of children
JS: at setFutureSnapshotsOfActivatedRoutes (file:///data/data/org.nativescript.tns57/files/app/tns_modules/@angular/router/bundles/router.umd.js:1950:19) [angular]
JS: at setFutureSnapshotsOfActivatedRoutes (file:///data/data/org.nativescript.tns57/files/app/tns_modules/@angular/router/bundles/router.umd.js:1954:13) [angular]
JS: at createNode (file:///data/data/org.nativescript.tns57/files/app/tns_modules/@angular/router/bundles/router.umd.js:1935:17) [angular]
JS: at file:///data/data/org.nativescript.tns57/files/app/tns_modules/@angular/router/bundles/router.umd.js:1975:20 [angular]
JS: at Array.map (<anonymous>) [angular]
JS: at createOrReuseChildren (file:///data/data/org.nativescript.tns57/files/app/tns_modules/@angular/router/bundles/router.umd.js:1958:30) [angular]
JS: at createNode (file:///data/data/org...
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ERROR Error: Uncaught (in promise): Error: Cannot reattach ActivatedRouteSnapshot with a different number of children
JS: Error: Cannot reattach ActivatedRouteSnapshot with a different number of children
JS: at setFutureSnapshotsOfActivatedRoutes (file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78144:15) [angular]
JS: at createNode (file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78129:13) [angular]
JS: at file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78169:16 [angular]
JS: at Array.map (<anonymous>) [angular]
JS: at createOrReuseChildren (file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78152:26) [angular]
JS: at createNode (file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78121:24) [angular]
JS: at file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78158:28 [angular]
JS: at Array.map (<anonymous>) [angular]
JS: at createOrReuseChildren (file:///data/data/org.nativescript.nsngcourse/files/app/vendor.js:78152:...
@vahidvdn Are you using router-outlet or page-router-outlet ?
It seems page-router-outlet handles correctly this issue and router-outlet not...unfortunately.
Ok maybe it’s not related to type of router outlet in your case.
Anyway, considering my issue, I’ve just replaced router outlet by page router outlet in my TabView’s children and the issue was gone.
It has to be linked somehow… I also wonder if this issue could be related to a clearHistory = true … I will give a try.
Sorry to be to not very useful … I’m still discovering NativeScript…
Hope this bug will be fixed for TabView and its children’s routes of Nativescript v6 … wait and see.
L.
I'm not sure if it will be helpful but in my case, the solution to this error was to use the additional parameter skipLocationChange in options of navigate method.
Activity
vahidvdn commentedon Jun 12, 2019
@NickIliev @tsonevn Any idea on this?
jocafi commentedon Jun 20, 2019
same problem here, but I am using Angular 8.0
vahidvdn commentedon Jun 25, 2019
@jocafi Yes, unfortunately, there is no feedback from anyone. Hope this will be fixed in new Tab-View Redesign
lostation commentedon Jun 27, 2019
@vahidvdn Are you using router-outlet or page-router-outlet ?
It seems page-router-outlet handles correctly this issue and router-outlet not...unfortunately.
vahidvdn commentedon Jun 29, 2019
@lostation No, page-router-outlet doesn't handle it correctly. See here.
Also see the issue at the same repo.
lostation commentedon Jun 30, 2019
bpaczkowski-merix commentedon Jul 14, 2019
I'm not sure if it will be helpful but in my case, the solution to this error was to use the additional parameter skipLocationChange in options of navigate method.
Eg.
mpilija commentedon Jul 16, 2019
Hi Guys,
Any news on this? Got the same issue while navigating back:
this.routerExtensions.back();
tskweres commentedon Sep 6, 2019
Same issue when using this.routerExtensions.back() with lazy-loaded tab routes
phpdev90 commentedon Sep 10, 2019
The same issue. Any idea?
tskweres commentedon Sep 10, 2019
@bpaczkowski-merix solution with skipLocationChange in the transition worked for me
alqabali commentedon Dec 12, 2019
some issue here!
mhmdhmd commentedon Dec 31, 2019
while navigating back use extra option in this.routerExtension.back()
use the following
this.routerExtension.back({relativeTo: this.activatedRoute});i hope it handles correctly this issue
prajilshresthaiw commentedon Jun 22, 2020
+1 for this issue.
prajilshresthaiw commentedon Jul 27, 2020
This worked for me.
cjohn001 commentedon Aug 22, 2020
+1 for the issue.
using
this.routerExtension.back({relativeTo: this.activatedRoute});
does not help.
PetroSuch commentedon Mar 24, 2021
Any idea about it ?
PetroSuch commentedon Mar 24, 2021
Guys, what is the solve of the problem /
PetroSuch commentedon Mar 24, 2021
i dont can use bottomnavigation inside my application, because i can go to component Tabs and but i can return back to him from different component