0
votes

I have a problem in my routing code in app Nativescript.

I have this:

const routes: Routes = [
  {
    path: 'home',
    component: HomeComponent,
    canActivate: [AuthGuard],
    children: [
      {path: 'fp', component: FirstPageComponent},
      {path: 'setting', component: SettingsComponent}]},
  {
    path: 'test',
    component: TestComponent,
    children: [
      { path: 'login', component: LoginFirstComponent },
      { path: 'login1', component: LoginComponent },
    ]},
  { path: '', redirectTo: '/home/fp', pathMatch: 'full' }
];

I routing in first: home/fp > home/setting > test/login Click back in mobile and in this part back navigate in test/login > home/setting > and in end show this error:

System.err: com.tns.NativeScriptException: System.err: Calling js method run failed System.err: System.err: Error: Calling startGoBack while going back. System.err: File: "file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js, line: 1, column: 948849 System.err: System.err: StackTrace: System.err: Frame: function:'c', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 963843 System.err: Frame: function:'t._beginBackPageNavigation', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 515811 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 662072 System.err: Frame: function:'e.invoke', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 953424 System.err: Frame: function:'t.runGuarded', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 948778 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 948390 System.err: Frame: function:'e.notify', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 558758 System.err: Frame: function:'t.onNavigatedFrom', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 1022304 System.err: Frame: function:'t.raiseCurrentPageNavigatedEvents', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 1077896 System.err: Frame: function:'t._updateBackstack', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 1077351 System.err: Frame: function:'t.setCurrent', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 521360 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 1298088 System.err: Frame: function:'e.invokeTask', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 954109 System.err: Frame: function:'t.runTask', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 949275 System.err: Frame: function:'t.invokeTask', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 955223 System.err: Frame: function:'o.useG.invoke', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 955121 System.err: Frame: function:'r.args.(anonymous function)', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 966636 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 1170073 System.err: Frame: function:'e.invoke', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 953424 System.err: Frame: function:'t.runGuarded', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 948778 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 948390 System.err: Frame: function:'run', file:'file:///data/data/org.nativescript.SecuritySystemMobile/files/app/vendor.js', line: 1, column: 1170132 System.err: System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:996) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:983) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:967) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:959) System.err: at com.tns.gen.java.lang.Runnable.run(Runnable.java:15) System.err:
at android.os.Handler.handleCallback(Handler.java:754) System.err:
at android.os.Handler.dispatchMessage(Handler.java:95) System.err:
at android.os.Looper.loop(Looper.java:163) System.err: at android.app.ActivityThread.main(ActivityThread.java:6228) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)

Image

Have you any idea please, how to solution this error?

1

1 Answers

0
votes

This looks like a webpack build, can you try without webpack so the error might be little easier to read.

Also if you could reproduce the issue with Playground, it will be much easier to debug.