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 read property 'reopen' of undefined #1004

Closed
lolmaus opened this issue Aug 7, 2019 · 0 comments · Fixed by #1005
Closed

Cannot read property 'reopen' of undefined #1004

lolmaus opened this issue Aug 7, 2019 · 0 comments · Fixed by #1005

Comments

@lolmaus
Copy link
Contributor

lolmaus commented Aug 7, 2019

Ran into this today:

"after each" hook for "Scenario: Applying a coupon with a free product"‣
TypeError: Cannot read property 'reopen' of undefined
    at Class.dropObject (<anonymous>:2978:18)
    at Class.willDestroy (<anonymous>:2951:18)
    at Class.superWrapper (assets/vendor.js:31574:22)
    at invoke (assets/vendor.js:54425:16)
    at Queue.flush (assets/vendor.js:54317:13)
    at DeferredActionQueues.flush (assets/vendor.js:54521:21)
    at Backburner._end (assets/vendor.js:55097:34)
    at Backburner.end (assets/vendor.js:54783:12)
    at Backburner._run (assets/vendor.js:55152:16)
    at Backburner.run (assets/vendor.js:54832:19)

Took me quite a while to figure out that the issue is caused by Ember Inspector. How freaky is that the Inspector breaks your tests! 😱

Found a report of this issue from four 😱😱 years ago: emberjs/ember.js#11863 (comment) @stefanpenner's reply is very interesting, though irrelevant to the cause of this particular problem.

Inspector crashes here:

dropObject(objectId) {
let object = this.sentObjects[objectId];
if (object.reopen) {
object.reopen({ willDestroy: object._oldWillDestroy });
delete object._oldWillDestroy;
}

Simply closing and reopening the inspector resulted in the issue not happening again, so I'm unable to share a reproduction.

But the fix is obvious, natural and free from side effects. I'll make a PR.

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

Successfully merging a pull request may close this issue.

1 participant