Hi,
I've come across and issue where the frameStack is empty on some Android devices. I'm not sure if this an issue for nativescript-vue-navigator or nativescript-vue or neither and something else is in my code is causing this issue. But I'll explain anyway and hopefully it'll help others at least.
Hi, I've come across and issue where the
frameStack
is empty on some Android devices. I'm not sure if this an issue fornativescript-vue-navigator
ornativescript-vue
or neither and something else is in my code is causing this issue. But I'll explain anyway and hopefully it'll help others at least.Starting here https://github.com/nativescript-vue/nativescript-vue-navigator/blob/5f80c730eb81f59e0597e2bce53279abcf859610/index.js#L73-L74
When
this.$navigate
is called we go into its definition at https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L69.On line 77 (https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L77), we call
getFrameInstance
. Then go to its definition at https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L37.On line 32 (https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L32), when the result of
require('@nativescript/core').Frame.getFrameById(frame)
isundefined
, causingundefined
to be assigned to theframe
variable.The later call involving
frame.id
(https://github.com/nativescript-vue/nativescript-vue/blob/c0e6f959096e81dd544cee01f8be4cebfd89eb87/platform/nativescript/plugins/navigator-plugin.js#L37) throws an errorCannot read property 'id' of undefined
and causes the navigation to never work.Work around:
Which will get around
frame.id
being undefined when thenavigator
frame should always be defined when using thenativescript-vue-navigator
plugin.Possibly associated to: