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

Freezes when (i think) zooming in #39

Open
deanveloper opened this issue Feb 27, 2022 · 4 comments
Open

Freezes when (i think) zooming in #39

deanveloper opened this issue Feb 27, 2022 · 4 comments

Comments

@deanveloper
Copy link

Sometimes when I zoom in (might be unrelated), the game freezes, and this stack trace is printed in console:

three.module.js:29649 Uncaught TypeError: Cannot read properties of undefined (reading 'count')
    at n.value (three.module.js:29649:45)
    at lu (three.module.js:46476:10)
    at lu (three.module.js:46486:4)
    at lu (three.module.js:46486:4)
    at lu (three.module.js:46486:4)
    at lu (three.module.js:46486:4)
    at e.value (three.module.js:46454:4)
    at Function.intersectingObjects (three-render-objects.module.js:408:24)
    at Function.Object.keys.forEach.i.<computed> [as intersectingObjects] (kapsule.module.js:176:65)
    at Function.tick (three-render-objects.module.js:249:35)
@deanveloper
Copy link
Author

gonna take a wild guess and say the stack trace isn't super helpful since it's minified... although it looks like it occurs inside of some recursive function since a few of the lines/columns of the stack trace are equal.

@canerder
Copy link

I experience the same issue of the game freezing frequently in Safari 15.4. To reproduce I simply have to play Globle normally for 1-5 minutes.

Safari's Web Inspector shows the problematic code on line 29990 of 'three.module.js': const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );

The URL of 'three.module.js' is shown as https://globle-game.com/static/node_modules/three/build/three.module.js, though loading this URL just shows Globle's homepage.

Here is the error stack:

[Error] TypeError: undefined is not an object (evaluating 'positionAttribute.count')
	value (three.module.js:29990)
	_u (three.module.js:46853)
	_u (three.module.js:46863)
	_u (three.module.js:46863)
	_u (three.module.js:46863)
	_u (three.module.js:46863)
	value (three.module.js:46831)
	tick (three-render-objects.module.js:249)
	_animationCycle (globe.gl.module.js:385)

@canerder canerder mentioned this issue Apr 24, 2022
@the-abe-train
Copy link
Owner

Hey everyone! Thanks for taking an interest in helping me improve the game. This particular issue troubles me a lot because I believe comes from the 3D globe library rather than any of the code I've written directly. I've looked into fixing it from a couple angles but honestly I don't know how to reliably prevent the globe from ever freezing. Gonna leave this issue open in case anyone has any ideas that might help.

@inordirection
Copy link

inordirection commented Jul 28, 2022

I've noticed a similar freezing issue either when panning the globe or zooming right after panning, and I do think it comes from three.js. This has always been my accompanying stack-trace:

Uncaught TypeError: d is undefined
    value three.module.js:30184
    il three.module.js:46805
    il three.module.js:46815
    il three.module.js:46815
    il three.module.js:46815
    il three.module.js:46815
    value three.module.js:46783
    intersectingObjects three-render-objects.module.js:415
    e kapsule.module.js:195
    tick three-render-objects.module.js:249
    e kapsule.module.js:195
    _animationCycle globe.gl.module.js:385
    e kapsule.module.js:195

with the relevant code with the undefined value d being in three-render-objects.module.js line 249:

if (state.hoverDuringDrag || !state.isPointerDragging) {
            var intersects = this.intersectingObjects(state.pointerPos.x, state.pointerPos.y).filter(function (d) {
              return state.hoverFilter(d.object);
            })
            ...

It seems like an undefined value is sometimes getting pushed into the array of intersects returned by the intersectingObjects function? I can't find the actual bug in their code though

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