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

select组件被destroy时出现TypeError: Cannot read property '__resizeListeners__' of undefined #3797

Closed
Ryan-PEK opened this issue Mar 27, 2017 · 34 comments

Comments

@Ryan-PEK
Copy link

Element UI version

1.2.5

OS/Browsers version

chrome 57

Vue version

2.2.6

Reproduction Link

Steps to reproduce

子页面使用el-select后,切换到其他子页面,在执行destory时出现如题JS error。
vue.runtime.esm.js:554 [Vue warn]: Error in destroyed hook:
(found in )
vue.runtime.esm.js:1443 TypeError: Cannot read property 'resizeListeners' of undefined
at removeResizeListener (resize-event.js:183)
at VueComponent.destroyed (scrollbar.js:245)
at callHook (vue.runtime.esm.js:2269)
at VueComponent.Vue.$destroy (vue.runtime.esm.js:2091)
at destroy (vue.runtime.esm.js:2958)
at invokeDestroyHook (vue.runtime.esm.js:4773)
at invokeDestroyHook (vue.runtime.esm.js:4778)
at VueComponent.patch [as patch] (vue.runtime.esm.js:5039)
at VueComponent.Vue.$destroy (vue.runtime.esm.js:2089)
at destroy (vue.runtime.esm.js:2958)

What is Expected?

没有JS Error

What is actually happening?

出现描述中的error

@Ryan-PEK Ryan-PEK changed the title ypeError: Cannot read property '__resizeListeners__' of undefined select组件被destroy时出现TypeError: Cannot read property '__resizeListeners__' of undefined Mar 27, 2017
Leopoldthecoder added a commit to Leopoldthecoder/element that referenced this issue Mar 27, 2017
@lincenying
Copy link

lincenying commented Mar 27, 2017

应该是vue 2.2.6改的vuejs/vue@3209f6f 这个的原因,

https://github.com/ElemeFE/element/blob/dev/packages/scrollbar/src/main.js#L128
这个应该也有问题.

@tbphp
Copy link

tbphp commented Mar 27, 2017

我也出现同样的问题,select销毁是报同样的错。

@Rranran
Copy link

Rranran commented Mar 28, 2017

+1

@tbphp
Copy link

tbphp commented Mar 28, 2017

jsfiddle示例

这个示例下面el-select隐藏的时候就会报错。
我已经测试过,vue2.2.6才会报错,2.2.5以下没有这个错误。

@rubickecho
Copy link

rubickecho commented Mar 28, 2017

+1,在被销毁时产生了警告

[Vue warn]: Error in destroyed hook:
(found in )
warn @ vue.common.js?e881:560
handleError @ vue.common.js?e881:1445
callHook @ vue.common.js?e881:2277
Vue.$destroy @ vue.common.js?e881:2097
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
invokeDestroyHook @ vue.common.js?e881:4779
invokeDestroyHook @ vue.common.js?e881:4784
patch @ vue.common.js?e881:5045
Vue.$destroy @ vue.common.js?e881:2095
destroy @ vue.common.js?e881:2964
(anonymous) @ vue.common.js?e881:3246
invokeDestroyHook @ vue.common.js?e881:4779
removeVnodes @ vue.common.js?e881:4795
updateChildren @ vue.common.js?e881:4902
patchVnode @ vue.common.js?e881:4936
patch @ vue.common.js?e881:5060
Vue._update @ vue.common.js?e881:2042
updateComponent @ vue.common.js?e881:2158
get @ vue.common.js?e881:2469
run @ vue.common.js?e881:2539
flushSchedulerQueue @ vue.common.js?e881:2331
(anonymous) @ vue.common.js?e881:507
nextTickHandler @ vue.common.js?e881:456
vue.common.js?e881:1449 TypeError: Cannot read property 'resizeListeners' of undefined

@thenCoding
Copy link

+1,同样遇到这个问题.看了半天以为代码哪里没写对,上来一看才发现这是个BUG啊,哈哈.

@Rranran
Copy link

Rranran commented Mar 28, 2017

这个问题还是存在的啊·@Leopoldthecoder

@Zeno-Code
Copy link

Zeno-Code commented Mar 28, 2017

全部更新了一遍,问题依旧
"dependencies": { "element-ui": "^1.2.6", "vue": "^2.2.6", "vue-router": "^2.2.0" }

@pa-bouly
Copy link

pa-bouly commented Mar 28, 2017

This problem still exists for me too (tried to reinstall all npm packages, etc)

@Leopoldthecoder
Copy link
Contributor

抱歉,只修了 Select,没修 Scrollbar。暂时先降级 Vue 吧。

@An0nymous0
Copy link

@Leopoldthecoder 预计下一版什么时候发布。 vue2.2.5 跟 vue-router 还有内存泄露的情况。

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

vue2.2.5 vue-router 和tabs还是会报错

@QingWei-Li
Copy link
Contributor

@An0nymous0 @bigrocs 今天吧

@QingWei-Li
Copy link
Contributor

@bigrocs

vue-router 和tabs还是会报错

哪个 issue?问题是啥

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

没有开issue 当我切换路由 或者tabs标签发送http请求是都会报错如下
Element UI version
1.2.6
OS/Browsers version
chrome 57
Vue version
2.2.6 or 2.2.5

[Vue warn]: Error in destroyed hook:
TypeError: Cannot read property '__resizeListeners__' of undefined

QingWei-Li added a commit to QingWei-Li/element that referenced this issue Mar 29, 2017
@QingWei-Li
Copy link
Contributor

@bigrocs
可否给重现链接?tabs 并没有使用 resize-event,也是 select 引起的么?

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

@QingWei-Li
我不确定什么引起的 我先排查下稍后给你答案

@tbphp
Copy link

tbphp commented Mar 29, 2017

@bigrocs
应该是tabs或者路由切换的时候销毁select销毁,然后导致触发这个bug。
我就是这个情况。
所以还是select的bug。
你可以把页面所有select都删除了,就不会有这个bug了

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

@tbphp
好像不行 我使用table组件的的页面也出现这个情况

@tbphp
Copy link

tbphp commented Mar 29, 2017

@bigrocs 你看你组件里面有没有select比如分页组件里面也有下拉组件。

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

@tbphp @QingWei-Li
我吧整个select引用都注释掉一样触发
我的好像是axios.post 访问开始触发这个BUG 奇怪..
然后访问结束在触发一次

不过正常打开的时候不触发 只有切换tabs 或者路由的时候触发
我的 切换tabs或者路由 都会执行axios.post

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

table也使用select组件 是我错了 。。。 确实是select引起的

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

@tbphp @QingWei-Li
我确定一件事情
分页组件 pagination 组件也引起了这个BUG

@HadiChen
Copy link

我也遇到了这个问题,每次页面切换时就会抛错
image

@faelssim
Copy link

我也出现了同样的问题,将select删除后并不会出现该问题,应该是select本身的问题吧,不知道什么时候能够给出解决方案?

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

组件 pagination 组件好像也是引用select组件引起的..

@bigrocs
Copy link

bigrocs commented Mar 29, 2017

什么时候发布修复版本

@QingWei-Li
Copy link
Contributor

v1.2.7 has been released.

@TaylerTao
Copy link

感谢!

@super-newbie94
Copy link

tim 20170421194607
请问该问题现在是如何解决了?
我将vue 2.2.6版本 升到最高,然后elementUi 1.2.7也升级到最高后不可以解决该问题。
将版本降下来后vue是2.2.5也不行。有解决的么

@Leopoldthecoder
Copy link
Contributor

@GaoYuanOnline 用 1.2.9

@super-newbie94
Copy link

@Leopoldthecoder 升级到1.2.9后可以解决该问题,谢谢!

@vincepeng
Copy link

还是有问题,尝试降级vue为2.2.5也是一样的
image
image

@tbphp
Copy link

tbphp commented Jul 16, 2017

@vincepeng 这都哪个版本了,你把你的包都npm-check -u升级一下,这个问题早就应该不存在了。

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

No branches or pull requests