Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

标签栏右键刷新后地址栏的redirect没有消失,控制台报错 #2032

Closed
TY-LIU opened this issue May 8, 2019 · 7 comments · Fixed by #2066
Closed

标签栏右键刷新后地址栏的redirect没有消失,控制台报错 #2032

TY-LIU opened this issue May 8, 2019 · 7 comments · Fixed by #2066

Comments

@TY-LIU
Copy link

TY-LIU commented May 8, 2019

Bug report:标签栏右键刷新后地址栏的redirect没有消失,控制台发出警告与错误信息。

但是线上没有这个问题,本地会出现。并且项目从3.8.x版本拉下来,去掉了原有的权限控制,改成了从后台获取菜单,其余没变化。
[vue-router] uncaught error during route navigation:

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at processState (backend.js:2108)
    at getInstanceState (backend.js:1958)
    at getCustomInstanceDetails (backend.js:1971)
    at backend.js:298
    at EncodeCache.cache (backend.js:234)
    at Object.replacer (backend.js:298)
    at encode (backend.js:2456)
    at encode (backend.js:2457)
    at encode (backend.js:2466)

Steps to reproduce(问题复现步骤)

右键标签,点击刷新

Screenshot or Gif(截图或动态图)

_20190508184408
_20190508184445
_20190508185042

Link to minimal reproduction(最小可在线还原demo)

无法提供

Other relevant information(格外信息)

  • Your OS: Win10 Chrome 74.0.3729.131 (正式版本) (64 位) (cohort: Stable)
  • Node.js version: v10.2.0
  • vue-element-admin version: 3.8.x
@TY-LIU
Copy link
Author

TY-LIU commented May 8, 2019

我侧栏与标签栏的代码与最新版本的代码一致,唯一不同的地方可能就是权限那里,但是是能正常加载路由的。我仔细看了跳转的方式,实在是不知道问题到底出在哪里

@OpenSourceLearners
Copy link

这个报错是因为devtools插件引起的。src/views/redirect/index.vue使用了beforeCreate钩子,还未初始化data就被跳转。导致devtools在获取data的时候为undefined。
解决办法:
方法一:关闭devtools
方法二:将beforeCreate换成created钩子
@PanJiaChen @TY-LIU

@TY-LIU
Copy link
Author

TY-LIU commented May 11, 2019

@OpenSourceLearners 哇老哥你是怎么发现这么隐蔽的bug的,我一直以为是我权限那块出了问题,想不到居然是devtools的锅。我就说怎么生产环境没有这个问题,十分感谢,这bug终于得到了解决

@OpenSourceLearners
Copy link

OpenSourceLearners commented May 11, 2019 via email

@OpenSourceLearners
Copy link

我最近也遇到这个问题,今天才解决的。

@PanJiaChen
Copy link
Owner

Fixed in #2066

@andyhuai
Copy link

为何我的还是不能跳转?

EdwinBetanc0urt added a commit to EdwinBetanc0urt/adempiere-vue that referenced this issue Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants