root.addEventListener is not a function
mr-xiao opened this issue · comments
dwyane commented
root.addEventListener is not a function
Jay Kent commented
I'm also running into this issue when I am updating my app to use Webpack. I am using the ES6 import to include the npm
package I installed.
import echo from "echo-js";
zloKOMAtic commented
Also got this issue not using es6 import but with webpack
Pierre Dickinson commented
Hi @zlokomatic @kentjas1
I have the same issue with webpack. What is the solution ?
Todd Motto commented
@pierre-dickinson It's probably due to this
and webpack bundling in 'strict mode' as this
may be undefined and therefore throw an error as addEventListener
won't exist:
https://github.com/toddmotto/echo/blob/master/dist/echo.js#L12
You can change the this
to window
and that should solve it.