question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'eventName' of undefined

See original GitHub issue

I’ve got a component which is conditionally rendered based on the value of a boolean. If that boolean value is changed by an action from within that component, the above error is thrown when the component is removed from the view.

Seems like it was introduced with canary and is happening from 2.13.0-alpha.1-canary+96c0bb79 onward.

Here’s a simple twiddle demonstrating: https://ember-twiddle.com/b86adfba657f450a4d264e01a3fb0d37?openFiles=templates.application.hbs%2Ctemplates.components.my-component.hbs

Seems related to #1643. The stack trace points to the same block patched by pivotal-topher-bullock@74e0d58.

Stack trace:

Uncaught TypeError: Cannot read property 'eventName' of undefined
    at HTMLButtonElement.<anonymous> (ember.debug.js:43826)
    at HTMLDivElement.dispatch (VM229 jquery.js:4670)
    at HTMLDivElement.elemData.handle (VM229 jquery.js:4338)
    at Object.trigger (VM229 jquery.js:4579)
    at Object.simulate (VM229 jquery.js:4906)
    at HTMLDocument.handler (VM229 jquery.js:5169)
    at clear (ember.debug.js:916)
    at UpdatableBlockTracker.reset (ember.debug.js:916)
    at TryOpcode.handleException (ember.debug.js:1070)
    at UpdatingVMFrame.handleException (ember.debug.js:1071)

// disclosed
(anonymous) @ ember.debug.js:43826
dispatch @ VM229 jquery.js:4670
elemData.handle @ VM229 jquery.js:4338
trigger @ VM229 jquery.js:4579
simulate @ VM229 jquery.js:4906
handler @ VM229 jquery.js:5169
clear @ ember.debug.js:916
reset @ ember.debug.js:916
handleException @ ember.debug.js:1070
handleException @ ember.debug.js:1071
_throw @ ember.debug.js:1070
evaluate @ ember.debug.js:862
execute @ ember.debug.js:1070
rerender @ ember.debug.js:1057
_this.render @ ember.debug.js:13523
runInTransaction @ ember.debug.js:24861
_renderRoots @ ember.debug.js:13784
_renderRootsTransaction @ ember.debug.js:13822
_revalidate @ ember.debug.js:13861
invoke @ ember.debug.js:1902
flush @ ember.debug.js:1970
flush @ ember.debug.js:2094
end @ ember.debug.js:2164
run @ ember.debug.js:2287
run @ ember.debug.js:24085
handler @ ember.debug.js:13301
(anonymous) @ ember.debug.js:43827
dispatch @ VM229 jquery.js:4670
elemData.handle @ VM229 jquery.js:4338

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
GavinJoycecommented, Jan 30, 2017

It looks like this guard is needed:

screen shot 2017-01-30 at 21 30 11

I’m working on a test now

0reactions
mixoniccommented, Mar 30, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Cannot read property 'name' of undefined on [event ...
However, I get the error TypeError: Cannot read property 'name' of undefined when I try to type a number in the phoneInput component....
Read more >
Cannot read property 'eventName' of undefined · Issue #3779 ...
The error suggests that cancel() was called before end() in .then handler. This suggests that "close" was invoked, and then load() succeeded.
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Error: Uncaught (in promise): TypeError: Cannot read property ...
I have got this error on my search function, but I am unable to resolve. Any idea? The error seems to be in...
Read more >
TypeError: Cannot read property 'first_name' of undefined
TypeError : Cannot read property 'first_name' of undefined. I have a Component to listen on a CardTest Event, to which I am passing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found