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 'addEventListener' of null

See original GitHub issue

Hey there!

I’m having a issue with ember 2.7.0 and ember-power-select 1.0.0-beta.8.

trigger.js:43 Uncaught TypeError: Cannot read property 'addEventListener' of null

The stack trace points to https://github.com/cibernox/ember-power-select/blob/a6364c7fe1692817c4572e7623116757e470b170/addon/components/power-select-multiple/trigger.js#L46

With ember 2.6.1 this error does not happen.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
corrsptcommented, Sep 18, 2016

Let me post some of my findings:

I had ember-power-select v1.0.0-beta.17 installed and ember-power-select-with-create v0.1.10, when I updated to ember-power-select-with-create v0.2.0 it started working.

Long version: I updated my package.json to reference the latest commit in Ember Power Select like this "ember-power-select": "git://github.com/cibernox/ember-power-select.git#b43879f13f0d2b3e19999ec5275f53c3b05ffcf0",

That didn’t work (I did delete node_modules and bower_components and reinstalled), one thing that I found odd was that while navigating through the source in my project I had the following code in trigger.js for power-select-multiple.

var optionsList = document.getElementById(this.elementId + '-ember-power-select-multiple-options');

But looking for this line of code in EPS source code, I could only find a reference to this.elementId in the changelog saying that it was removed. Which means that I was somehow using an “older” power-select?

That’s when I remembered to update power-select-with-create which now has on its own package.json version 1.0.0-beta.14, but previously (on 0.1.10 has version 0.10.X of EPS).

Hope it helps someone.

0reactions
snewcomercommented, Sep 29, 2016

I’ll try to get a twiddle up in the next few days

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'addEventListener' of null - Stack Overflow
I think the easiest approach would be to just check that el is not null before adding an event listener: var el =...
Read more >
Uncaught TypeError cannot read property 'addeventlistener' of ...
In JavaScript, a very common error is the Uncaught TypeError Cannot read property 'addeventlistener' of null. This error occurs when JavaScript is not...
Read more >
[SOLVED] Cannot Read Property 'addEventListener' of Null in ...
To fix the “cannot read property 'addEventListener' of null” error, make sure the selector used the access the element is properly defined.
Read more >
Cannot read property 'addEventListener' of Null in JS
The error "Cannot read property addEventListener of null" occurs when we call the addEventListener() method on a DOM element that doesn't exist.
Read more >
Cannot read property 'addEventListener' of null - JavaScript
I'm working on this simple ToDo list script but get the following error: “Uncaught TypeError: Cannot read property 'addEventListener' of ...
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