Vue-Router 2: Uncaught RangeError: Maximum call stack size exceeded

Yeasterday, I found my front-end Vuejs program printed error like this:

Uncaught RangeError: Maximum call stack size exceeded
    at def (eval at <anonymous> (app.js:650), <anonymous>:342:30)
    at new Observer (eval at <anonymous> (app.js:650), <anonymous>:673:3)
    at observe (eval at <anonymous> (app.js:650), <anonymous>:749:10)
    at initData (eval at <anonymous> (app.js:650), <anonymous>:3196:3)
    at initState (eval at <anonymous> (app.js:650), <anonymous>:3121:5)
    at VueComponent.Vue._init (eval at <anonymous> (app.js:650), <anonymous>:3378:5)
    at new VueComponent (eval at <anonymous> (app.js:650), <anonymous>:3500:12)
    at createComponentInstanceForVnode (eval at <anonymous> (app.js:650), <anonymous>:1724:10)
    at init (eval at <anonymous> (app.js:650), <anonymous>:1734:43)
    at createComponent (eval at <anonymous> (app.js:650), <anonymous>:4174:9)

I was quickly establishing the basic structure of my new project at that time, and so there were many details I ignored. When I found the above error information, I was shocked. WTF is it?

After some attempts, I found the problem is that there were some Vuejs component named “RouterView” which has <router-view></router-view> inside them, and that was the cause. After I renamed their router component to names other than “RouterView”, the above error information disappeared.

Author: Yakima
关于作者:楠溪江人,出生于1991年,目前坐标上海。读书时代跳过级、保过送,工作后转过行。2013年本科毕业于北药。看书、码字、敲代码、打羽毛球是我花时间的爱好。曾在某上市药企任国际药品注册岗,现在某高新企业任前端管理岗。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据