this.handlers is undefined
See original GitHub issueWavesurfer.js version(s):
4.1.0
Code needed to reproduce the issue:
Region plugin doesn’t load, check example page:
https://wavesurfer-js.org/plugins/regions.html
When calling this.regions.add(options)
.
Line 199 of regions/index.js registers this event:
region.on('remove', () => {
delete this.list[region.id];
});
Results in TypeError: can't access property "remove", this.handlers is undefined
Last change to observer: https://github.com/katspaugh/wavesurfer.js/commit/590d9ccc96f6c69090849f2e5cfb4587da647ee5 Looks like removing the lazy creation of handlers object broke the regions plugin.
Found this comment in observer.js: * plugins borrow part of this class without calling the constructor
Can we do something about that without breaking existing plugins? Not calling the constructor doesn’t sound very good.
Worst case scenario we revert to what we were doing before.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top Results From Across the Web
TypeError: handler is undefined - javascript - Stack Overflow
While handler is declared, it will remain undefined because at that point in time, based on how you assign initial values to your...
Read more >Deal with Undefined 'this' in React Event Handlers Correctly
When teaching React to developers, one thing that comes up often is dealing with a common error. In this post, learn how to...
Read more >How to Fix ReferenceError: Event is Not Defined in JavaScript
JavaScript's ReferenceError: Event is Not Defined occurs if the event parameter is not declared correctly when using an event handler.
Read more >Adapters • Waypoints - I Make Web Things
undefined . ... This binds an event listener to the element. Only a subset of jQuery's on needs to be implemented. Multiple space...
Read more >undefined - JavaScript - MDN Web Docs - Mozilla
In all non-legacy browsers, undefined is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. A ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
4.1.1 was released and fixes this issue.
@sundayz please do.