profile
viewpoint

Ask questions[Vue warn]: Error in nextTick: "RangeError: Maximum call stack size exceeded" while navigating to another route

Hi,

This seems to be happening in rare cases, when I change the route I happened to see this issue,

[Vue warn]: Error in nextTick: "RangeError: Maximum call stack size exceeded"

but it changes to correct route URL in the browser URL bar, but it is not rendering the correct component of the active route. This is the router file. Am I missing something?

import Vue from 'vue'
import Router from 'vue-router'
import store from './store/store'
import VueCookie from 'vue-cookie'

Vue.use(Router)
const router = new Router({
  routes: [
    {
      path: '*',
      redirect: '/login'
    },
    {
      path: '/',
      beforeEnter (from, to, next) {
        if (!VueCookie.get('authToken')) {
          next('/login')
        } else {
          next('/dashboard')
        }
      }
    },
    {
      path: '/login',
      name: 'login',
      component: require('./views/Login').default,
      beforeEnter (from, to, next) {
        if (!VueCookie.get('authToken')) {
          next()
        } else {
          next(to.path)
        }
      }
    }
  ]
})

router.beforeEach((to, from, next) => {
	if (!VueCookie.get('authToken')) {
	  store.commit('logout')
	  next({
		path: '/',
		query: { redirect: to.fullPath }
	  })
	} else {
	  next()
	}
})

export default router

thanks in advance!

vuejs/vue

Answer questions vue-bot

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

useful!

Related questions

关于keep-alive缓存页面问题请教 hot 1
Can not clear slot content with vue@2.5.3 hot 1
TypeError: Cannot read property 'toLowerCase' of undefined at emptyNodeAt hot 1
VNode.componentInstance is undefined when rendered by a functional component hot 1
Korean input trigger keydown event twice hot 1
Proposal: Template inheritance using the slots mechanism hot 1
Memory leak when using "transition" and "keep-alive" hot 1
Error in v-on handler: "RangeError: Maximum call stack size exceeded" hot 1
如何通过v-bind:style动态生成背景图? hot 1
如何通过v-bind:style动态生成背景图? hot 1
IE11, console print: [Vue warn]: Error in nextTick: "Error: Invalid argument." But work well with chrome hot 1
v-bind:style 'background-image' error: url is not a function hot 1
force re-computation of a computed property hot 1
v-model on mobile not updating until a space is pressed hot 1
There is no a attribute like react's $$typeof to prevent XSS injection in the vnode of Vue. hot 1
Github User Rank List