react-globe.gl
react-globe.gl copied to clipboard
Raycast exception: Cannot read property 'count' of undefined
I got my globe working now, it's looking amazing.
However, quite often if I hover over it or try to drag it, it throws an exception:

After that, the globe won't allow the user to rotate it anymore. It's stuck to its current position and rotation.
What might cause this?
I can reproduce it pretty reliably if
- there is a label at lat = 0, lon = 0
- I hover the mouse over it
- and then move the mouse within the label's dot
- but only if I don't rotate the globe before hovering
@derwaldgeist I've tried your steps but am unable to replicate the issue unfortunately.
Could you make a simple reduced example on https://codesandbox.io/ that reliably replicates the issue so it can be debugged?
I have the same issue in https://github.com/vasturiano/globe.gl/ this version.
But I can't reproduce it in a certain way, it's quite random...

@maker2002 thanks for contributing. I'm still unable to replicate this issue. Are you able to do an example on https://codesandbox.io that produces this error, even if just occasionally?
Yep, I agree, if seems to happen at random. I just felt it was more reproducible if I hovered above a label created at 0,0. But also here not always.
I have the same problem and cannot reproduce it reliably, it happens randomly. I am using react-globe.gl with Next.js
While I was tinkering with react-globe.gl (the official example) I also encountered this error three times. It indeed was very random and I also couldn't reproduce it reliably.
Can confirm the exact same issue. Seems to happen randomly. Sorry this is not much help in tracking down the root cause.
(edit: here's the code that's throwing the error. maybe that will help)
Same here!
FYI:
I managed to fix this by wrapping this else block of code in an if to check that positionAttribute was set
I did it in my node_modules/three/build/three.module.js which isn't ideal but didn't really know how else to do it.
I just need to remember to do this again if I ever reinstall three via npm or something.
Maybe it needs to be fixed in the three.js repo.
if (positionAttribute) {
const start = Math.max( 0, drawRange.start );
const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );
...
}
Hi, I have the same problem, any news about a fix?
its the draw range......
its because we were calling intersectObject on a mesh like Points.....at least for me and the count was messed up
Maybe this merge request will help?
https://github.com/mrdoob/three.js/pull/28163