A
Alokai•8mo ago
haiderpk

navigation guard

When i refresh a product page, an error is thrown of navigation guard. This error is getting triggered either i land from home page to product page or even perform a simple refresh on homepage. Vuestorefront version = 1.11.0 vue= 2.6.6 vue-router=3.0.1
(node:94263) UnhandledPromiseRejectionWarning: Error: Redirected when going from "/" to "/corsica-gloss-white-wall-hung-short-projection-basin-drawer-vanity-600mm-c76236" via a navigation guard.
at createRouterError (/home/haider/0_TM/1_vsfront/bathroom/vuestore/node_modules/vue-router/dist/vue-router.common.js:2067:15)
at createNavigationRedirectedError (/home/haider/0_TM/1_vsfront/bathroom/vuestore/node_modules/vue-router/dist/vue-router.common.js:2026:10)
at /home/haider/0_TM/1_vsfront/bathroom/vuestore/node_modules/vue-router/dist/vue-router.common.js:2373:17
at server-bundle.js:15264:29
at step (server-bundle.js:47293:23)
at Object.next (server-bundle.js:47274:53)
at fulfilled (server-bundle.js:47264:58)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:94263) UnhandledPromiseRejectionWarning: Error: Redirected when going from "/" to "/corsica-gloss-white-wall-hung-short-projection-basin-drawer-vanity-600mm-c76236" via a navigation guard.
at createRouterError (/home/haider/0_TM/1_vsfront/bathroom/vuestore/node_modules/vue-router/dist/vue-router.common.js:2067:15)
at createNavigationRedirectedError (/home/haider/0_TM/1_vsfront/bathroom/vuestore/node_modules/vue-router/dist/vue-router.common.js:2026:10)
at /home/haider/0_TM/1_vsfront/bathroom/vuestore/node_modules/vue-router/dist/vue-router.common.js:2373:17
at server-bundle.js:15264:29
at step (server-bundle.js:47293:23)
at Object.next (server-bundle.js:47274:53)
at fulfilled (server-bundle.js:47264:58)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
i did lookedup over internet that this could be issue with vue-router, i updated the vue-router version but still this error i am facing. I am still trying to debug it, but the reason is not known that why even on refresh getting this following error. Due to this the PM2 on server is populated with these errors, and we are assuming this is also causing issue for server downtimes. If anyone direct me for how can i resolve this issue on VSF1.
No description
5 Replies
haiderpk
haiderpk•8mo ago
Issue seems to be generated from this adapter file. it loads the product data from elastic search , this same code run ok for all other indexes of elastic search but for product it throw error.
No description
rohrig
rohrig•8mo ago
Hi @haiderpk 👋 I'll see if I can get an Engineer familiar with VSF1 to have a look. Please let me know if you solve it in the meantime.
haiderpk
haiderpk•8mo ago
Thankyou @rohrig , Yes sure i will update my findings here as well as i am also currently working on this.
rohrig
rohrig•8mo ago
I got a response from our engineers. They suggested you find the Route URL Resolver code and debug it line be line.
haiderpk
haiderpk•8mo ago
seems like if i remove /p/ from the product routes in router file. the navigation guard error goes away. but in Product.vue file from pages. we loose parentSku from params.
async asyncData ({ store, route }) {
console.log('route.params', route.params);
const product = await store.dispatch('product/loadProduct', {
// parentSku: route.params?.parentSku || 'C76236',
parentSku: route.params?.parentSku,
childSku:
route && route.params && route.params.childSku
? route.params.childSku
: null,
route: route
})
async asyncData ({ store, route }) {
console.log('route.params', route.params);
const product = await store.dispatch('product/loadProduct', {
// parentSku: route.params?.parentSku || 'C76236',
parentSku: route.params?.parentSku,
childSku:
route && route.params && route.params.childSku
? route.params.childSku
: null,
route: route
})
` the commented out line is where i tried to give static sku to make sure if product page gets loaded and there is no navigation guard error. and seems like there was no error. but when i continue with p as default, it first hits page-not-found, then hits back to real product page.
No description
Want results from more Discord servers?
Add your server