[BUG]: destroy() method didn't fully remove events
Question
version: latest: v-0.16.3.
important: update from v-0.15.9 to v-0.16.3 while keep everything same, the error will show in console:
Uncaught TypeError: Cannot read property 'frameElement' of null
at r.getFrameOffset (grapes.min.js?a826:formatted:28973)
at r.getElementPos (grapes.min.js?a826:formatted:28985)
at r.getElementPos (grapes.min.js?a826:formatted:13792)
at r.updateLocalPos (grapes.min.js?a826:formatted:13444)
at r.onFrameUpdated (grapes.min.js?a826:formatted:13396)
at I (grapes.min.js?a826:formatted:554)
at eval (grapes.min.js?a826:formatted:566)
at eval (grapes.min.js?a826:formatted:129)
....
This error show there is a errro in function getFrameOffset, near position: e.ownerDocument.defaultView.frameElement:
...
clearOff: function() {
this.frmOff = null,
this.cvsOff = null
},
getFrameOffset: function(e) {
if (!this.frmOff || e) {
>>> var t = e ? e.ownerDocument.defaultView.frameElement : this.frame.el;
this.frmOff = this.offset(t)
}
return this.frmOff
},
getCanvasOffset: function() {
return this.cvsOff || (this.cvsOff = this.offset(this.el)),
this.cvsOff
}
...
Refer to This Code Line
Checking the error stack will track to This Code Line
Expected: no error reported. Impact: I do not get specific negitive impact, only show the error. Reproduce: I integrate with Vue usage + webpack, hard to really reproduce, to debug this probaly check:
- simply add check chain to avoid
TypeError:
before: var t = e ? e.ownerDocument.defaultView.frameElement : this.frame.el;
after: var t= (e && e.ownerDocument && e.ownerDocument.defaultView && e.ownerDocument.defaultView.frameElement) || this.frame.el;
- if this
frameElementis required, in what condition it will missing, and then cause error.
Answers (3)
I agree that this needs to be reopened and fixed within the destroy function itself.
Thank you @artf ! 🙏
Thanks for the report @wemod123 Are you able to create a reproducible live demo of the issue?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2771
[BUG] component with textable:1 not working since version 0.16.12
Hello, I've just updated to the lasted version 0.16.12 and have a bug when trying to move a component that has the property textable:1 into...
Issue #2044
Npm start to develop on local server didn't work
Did the procedure to start the local server using dev branch as described on README, it worked on the console, but fails on chrome and the...
Issue #2571
[BUG] Layer visibility btn
If I change the state of the visibility btn - gjs will remove display style and then when I click "show layer" - it won't restore display s...
Issue #3575
grapes.min.js:2 Uncaught TypeError: Cannot read property 'length' of undefined
I got this error when add the <iframe src="https://app.conversiobot.com/boot/fvMEvO" width="100%" height="500" frameBorder="0" allow="geolo...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.