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

Cannot define property:__ob__ in android 5.0.2 #1995

Closed
changexbc opened this issue Dec 9, 2015 · 6 comments
Closed

Cannot define property:__ob__ in android 5.0.2 #1995

changexbc opened this issue Dec 9, 2015 · 6 comments

Comments

@changexbc
Copy link

系统:android5.0.2
错误:Uncaught TypeError: Cannot define property:ob, object is not extensible
工具:babel5+webpack1.12(babel6依旧有此问题)
版本:vue@1.0.10+vue-router@0.7.7

在点击有路由跳转事件的元素时路由不跳转并出现如下错误(v-link和router.go都会出错):

Uncaught TypeError: Cannot define property:__ob__, object is not extensible. vue.common.js:296
def vue.common.js:296
Observer vue.common.js:1995
observe vue.common.js:2122
reactiveSetter vue.common.js:2182
_onTransitionValidated vue-router.common.js:2411
(anonymous function) vue-router.common.js:1445
step vue-router.common.js:1480
(anonymous function) vue-router.common.js:1483
deactivate vue-router.common.js:1094
step vue-router.common.js:1482
runQueue vue-router.common.js:1477
(anonymous function) vue-router.common.js:1441
step vue-router.common.js:1480
(anonymous function) vue-router.common.js:1483
(anonymous function) vue-router.common.js:1073
(anonymous function) vue-router.common.js:821
Vue._resolveComponent vue.common.js:8125
resolveAsyncComponent vue-router.common.js:819
canActivate vue-router.common.js:1065
step vue-router.common.js:1482
runQueue vue-router.common.js:1477
(anonymous function) vue-router.common.js:1440
step vue-router.common.js:1480
(anonymous function) vue-router.common.js:1483
canDeactivate vue-router.common.js:1048
step vue-router.common.js:1482
runQueue vue-router.common.js:1477
start vue-router.common.js:1439
startTransition vue-router.common.js:2370
_match vue-router.common.js:2384
onChange vue-router.common.js:2029
listener vue-router.common.js:954

刷新之后路由跳转到之前未跳转的路由
目前这个错误只在android5.0上会出现,android5.1,android4.x,ios无此问题

换回vue@0.12.16+vue-router@0.6.0后正常,应该vue1.0的问题

@yyx990803
Copy link
Member

我手头没有 5.0 的机器,你看下在这一行 https://github.com/vuejs/vue/blob/dev/src/observer/index.js#L160
Object.isFrozen(value) 的值是什么?

@yyx990803
Copy link
Member

你看下把那一行的 Object.isFrozen 改成 Object.isExtensible 是否还抛错。

@changexbc
Copy link
Author

Object.isFrozen(value)的值一直都是都是false
Object.isFrozen(value)改成Object.isExtensible(value)之后进入页面直接报Uncaught TypeError: Cannot define property:__ob__, object is not extensible.,包括anroid4.x和ios也报错。。。
另外Object.isExtensible(value)的值也是false

@yyx990803
Copy link
Member

是我没说清楚,是把 !Object.isFrozen 改成 Object.isExtensible,改的时候要去掉前面那个取反

@changexbc
Copy link
Author

!Object.isFrozen 改成 Object.isExtensible之后没有报错了,非常感谢

@qiu8310
Copy link

qiu8310 commented Dec 14, 2015

我用 vue@1.0.10 时正好也遇到了这个问题,不过只是在安卓上的几乎所有的 QQ 浏览器上才会出现。

更新 vue 版本号后就正常了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants