Skip to content

Uncaught ReferenceError: resetTriggers is not defined #54

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

Open
tannerlinsley opened this issue Apr 29, 2018 · 3 comments
Open

Uncaught ReferenceError: resetTriggers is not defined #54

tannerlinsley opened this issue Apr 29, 2018 · 3 comments

Comments

@tannerlinsley
Copy link

Using in create-react-app as a fresh install on the latest versions of everything, I'm getting this error. Not sure why it's happening, since the function is actually getting registered. Maybe it's not getting hoisted correctly?

The call is being made from here:
https://github.com/sdecima/javascript-detect-element-resize/blob/master/detect-element-resize.js#L124

@mrjamesriley
Copy link

We came across the same issue. It would appear this is due to the fact that, as of ES2015 - a function within a conditional if block, is scoped to that block - and thus not available outside. Given that I'm using this in a require, the solution I've taken here is to use my own copy of the detect-element-resize file - with the if (!attachEvent) { conditional commented out.

@wilkerlucio
Copy link

Same issue here =/

@kegi
Copy link

kegi commented Jun 4, 2020

@mrjamesriley's fix is working. Thanks

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

No branches or pull requests

4 participants