question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot set property 'geometry' of undefined

See original GitHub issue

I’m rendering Cesium with Angular-Cesium. But this problem also occured when just running Cesium.js, which is Why I’m also posting here.

I’m rendering a kml stream and updating it every 1.5 seconds. Sometimes, it loads perfectly, no errors, and sometimes I get the error below. this is with no code changes. Also, If I set the interval to 10 seconds, It seems to solve the problem as far as I can tell… But of course, I’m trying to get an interval of 1.5 seconds.

screenshot from 2017-10-30 12-13-59

My code is really simple, here is my Angular code. Notice the AfterViewInit hook.

export class GlobeComponent implements OnInit, AfterViewInit {
    cesiumViewer;
    options;
    kml$;

    constructor(private viewersManager: MapsManagerService,
                private globeService: GlobeService) {}

    ngOnInit() {
      // console.log(this.cesiumViewer);
    }

    ngAfterViewInit() {
        const viewer = this.viewersManager.getMap('main-map').getCesiumViewer()

        this.options = {
            camera: viewer.scene.camera,
            canvas: viewer.scene.canvas
        };

        this.kml$ = new Cesium.KmlDataSource(this.options);

        viewer.dataSources.add(
        this.kml$
        );

        setInterval(() => {
            this.kml$.load('http://..../rest/kml/accept/all', this.options);
        }, 1500);

    }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
NichijouCCcommented, Oct 15, 2019

image createGeometryResults.length is > the instances.length ,so alert error.in my debug

0reactions
shuntercommented, Jan 23, 2020

I’m not sure which is the right fix. It seems dangerous for the batch to be directly manipulating the geometryInstances. I’m not sure from reading it whether the batch code was written with the awareness that the array is actually being shared or not. @mramato any recollections here?

Alternatively we could change packCombineGeometryParameters to just discard createGeometryResults for which we no longer have a geometryInstances. I guess they are correlated by index in the arrays. Maybe it needs to be smarter than that, since presumably adding new entities during CREATING could happen to, or we could delete then add and end up referencing the wrong geometry instance. This goes back to the danger of directly manipulating Primitive.geometryInstances externally from the batch, I guess.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Maps: Cannot read property 'geometry' of undefined
Im getting an error when trying to show markers on a map, from a JSON feed. Im getting alot of adresses, and then...
Read more >
TypeError: Cannot set property 'geometry' of undefined
TypeError : Cannot set property 'geometry' of undefined ... I am trying to set the colour of an entity using ColorMaterialProperty.
Read more >
TypeError: Cannot set property 'geometry' of undefined - Support
This error is happening in 2.30 from, at least, september 2020. Cannot check in play since the build is from late may Build...
Read more >
Intermittent error: "TypeError: Cannot set property 'geometry' of ...
Intermittent error: "TypeError: Cannot set property 'geometry' of undefined" ... Hello,. From the code you posted, everything looks fine. Is there ...
Read more >
Cannot set property 'geometry' of undefined - Esri Community
"Cannot set property 'geometry' of undefined" and the form fails to submit. Depending on the browser, sometimes there is no message and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found