Skip to content
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

Error: Element is not detectable by this strategy #81

Closed
alexjlockwood opened this issue Jun 19, 2017 · 6 comments
Closed

Error: Element is not detectable by this strategy #81

alexjlockwood opened this issue Jun 19, 2017 · 6 comments

Comments

@alexjlockwood
Copy link

alexjlockwood commented Jun 19, 2017

This may not be a bug in the library... might be an issue on my part.

I've gotten an error report from a user with the below trace. I tried looking at the source code but wasn't certain about when the error actually occurs. The user and I are both using the latest version of Chrome 59 and yet I'm unable to reproduce the issue myself.

Is there any particular reason why this error would be thrown and are there any obvious ways that it can be avoided?

vendor.d62c677178de6bb28515.bundle.js:8 ERROR Error: Element is not
detectable by this strategy.
    at Object.e [as addListener] (vendor.d62c677178de6bb28515.bundle.js:331)
    at vendor.d62c677178de6bb28515.bundle.js:331
    at vendor.d62c677178de6bb28515.bundle.js:331
    at r (vendor.d62c677178de6bb28515.bundle.js:331)
    at HTMLObjectElement.s (vendor.d62c677178de6bb28515.bundle.js:331)
    at HTMLObjectElement.o [as __zone_symbol___onload]
(polyfills.941f119dea8a6d6529f8.bundle.js:8)
    at t.invokeTask (polyfills.941f119dea8a6d6529f8.bundle.js:36)
    at Object.onInvokeTask (vendor.d62c677178de6bb28515.bundle.js:153)
    at t.invokeTask (polyfills.941f119dea8a6d6529f8.bundle.js:36)
    at r.runTask (polyfills.941f119dea8a6d6529f8.bundle.js:36)
v @ vendor.d62c677178de6bb28515.bundle.js:8

It seems like the crash is happening on this line of code, which is being called as a result of a call I am making to erd.listenTo(element, callbackFn) here. The element I am trying to listen to is here.

(IDK if any of that info is helpful, but just thought I would be as detailed as I could).

@joerogers
Copy link

FYI, I'm the user in question: I'm on Chrome 59.0.3071.104 and MacOS version 10.12.5 if that helps anything.

@wnr
Copy link
Owner

wnr commented Jun 20, 2017

Hi, and thanks both of you for the information. You are using the object-strategy, which is way less popular than the scroll-strategy. May I suggest trying the scroll-strategy and see if the problem still occurs? You do so by passing "scroll" to the "strategy" option to the constructor, like so:

var erd = elementResizeDetectorMaker({
  strategy: "scroll"
});

@alexjlockwood
Copy link
Author

Will do, I just published an update with the change. @joerogers LMK if you see any difference (you might need to CMD + SHIFT + R to clear the cache).

@joerogers
Copy link

The fix seems to have solved the issue I was having. Thanks @alexjlockwood

@alexjlockwood
Copy link
Author

Great! :)

I'll leave it up to @wnr if he wants to close the issue. But seems like that must have been the problem. Thanks for the suggestion!

@wnr
Copy link
Owner

wnr commented Jun 21, 2017

Awesome!

I'll see if there's anything I can do about this problem regarding the object strategy. I've found issues before with Chrome that was unresolvable. That's why I deprecated this strategy, but I did not want to break the current API. But it is great that the scroll strategy fixed it for you guys :)

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

3 participants