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

Unable to get property 'getCursorPosition' of undefined or null reference #24

Open
simeonpashley opened this issue Jul 23, 2018 · 11 comments

Comments

@simeonpashley
Copy link

When using v2.5.0, I see numerous entries in Sentry with the same error report. I haven't used previous versions so I don't know if this is a new issue.

Unable to get property 'getCursorPosition' of undefined or null reference

In the code excerpt below, it implies that this.core is null/undefined

            this.schedulActivation(this.props.hoverDelayInMs);
        }
    }, {
        key: 'onMouseMove',
        value: function onMouseMove(e) {
            this.setPositionState(this.core.getCursorPosition(e));
        }
    }, {
        key: 'onMouseLeave',
        value: function onMouseLeave() {
            this.clearActivationTimers();

All the issues seem to be IE11 / Edge....
https://sentry.io/share/issue/b315166598af4d818172fd34cf2508db/
https://sentry.io/share/issue/4e135f3320604ae88d31a56f503906d7/
https://sentry.io/share/issue/b2a9bcd3f7144fe5b0f15cd1b5a2f81f/

@ethanselzer
Copy link
Owner

ethanselzer commented Jul 24, 2018

Hi @simeonpashley - Thanks for reporting this issue. I released a possible fix in version 2.5.1-0. Please try it by installing [email protected]. In case you are interested, the branch with the changes is named issue24. Please let me know your findings. ~Ethan

@simeonpashley
Copy link
Author

Thanks, I'll give that a try.

FYI I'm using a component react-image-magnify, which uses your component

@ethanselzer
Copy link
Owner

Thank you for trying version 2.5.1-0. I appreciate it.

I had a look at react-image-magnify. It seems like it specifies version 2.4.1 of react-cursor-position. I'm wondering if you know why you have [email protected]

@ethanselzer
Copy link
Owner

@simeonpashley - I am able to reproduce the issue you identified in Windows Edge. I think it is corrected in v3.0.0. Thanks again for bringing it to my attention. I appreciate it!

@ethanselzer
Copy link
Owner

Anyone experiencing the "Unable to get property 'getCursorPosition' of undefined or null reference" issue in MS Edge, and also want the v2.x API, you can try v2.5.3.

@ethanselzer
Copy link
Owner

@simeonpashley - Thanks again for opening this issue. I'm closing it as fixed in latest and v2.5.3. Please let me know if you don't think it has been corrected.

@kimsangw
Copy link

kimsangw commented Jan 11, 2019

@ethanselzer Hi, I got this error from Sentry with v3.0.3

ReactCursorPosition.js:164 Uncaught TypeError: Cannot read property 'getCursorPosition' of undefined
   at t.value (ReactCursorPosition.js:164)

@ethanselzer
Copy link
Owner

Hi @kimsangw - Thanks for the information. Do you know if Sentry can provide details about the browser/OS? Also is there a high rate of this error?

@ethanselzer ethanselzer reopened this Jan 12, 2019
@kimsangw
Copy link

@ethanselzer there isn't any details about the browser but the rate of error is low.

@ethanselzer
Copy link
Owner

@kimsangw - Thanks for following up. I will investigate.

@vincentdesmares
Copy link

Hi @ethanselzer, sentry is sending at least one time per day this error. I was also thinking is was an IE-only bug, but the last report was for Chrome. Here is the details about the user:

Browser: Chrome 81.0.4044
browser.name: Chrome
device: Mac
device.family: Mac
os: Mac OS X 10.11.6
os.name: Mac OS X
url: https://teamstarter.co/

The code breaks here:

    });
    }
  }, {
    key: 'onClick',
    value: function onClick(e) {
      this.setPositionState(this.core.getCursorPosition(e)); <--- HERE
      this.mouseActivation.mouseClicked();
      this.onMouseDetected();
    }
  }, {
    key: 'onTouchDetected',

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