When using a custom loading component, router to one pageA, start in nuxt loading components excute, but middleware redirect to pageB( eg: login page )
pageA: finish in nuxt loding components should excute.
pageA: finish in nuxt loding components dont excute.
Please create a reproduction
custom nuxtLoading component:
<template>
<div />
</template>
<script>
export default {
data() {
},
methods: {
start() {
console.log('nuxt loading start');
},
finish() {
console.log('nuxt loading start');
}
}
};
</script>
global middleware:
export default (ctx) => {
ctx.redirect(pageB)
};
when go to pageA, I find nuxtLoading of pageA start but dont finish
The same thing happens to me, a loop is generated in the middleware
@gongzhibin @MauricioHernanCabrera Please create a CSB for reproduction via https://template.nuxtjs.org/
@manniL I apologize for the inconvenience, it was just a problem with other dependencies of my project
Closing this based on @MauricioHernanCabrera's comment :relaxed:
If the issue persists, please @ me here
@manniL https://codesandbox.io/s/yqrm9rwz89
you click button 'to A and redirect B', and open console, you can find loading start and dont finish
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as 馃晲Pending will not be automatically marked as stale.
export default async ({ store, redirect, app }) => {
/*global $nuxt*/
if ($nuxt.$route.path == "/v2/cameras/add" && !store.getters.is_admin) {
redirect("/v2/cameras")
}
}
I am having the same issue and it doesn't stop loading
Hey, Nuxt developers, how to fix this bug?