Select to view content in your preferred language

Uncaught (in promise) TypeError: Cannot read property 'items' of null

1133
1
04-07-2021 01:26 PM
JérômeCauchon
New Contributor

Hello,

         I just upgrades from 4.11 to 4.18 and i got an issue that a cannot figured how to resolve.

I can reproduce it by two different ways:

  • When creating a polygon with the sketch widget. After my first click on the map, the error occurs and the sketch is cancel.

 

this.sketch = new Sketch({
      layer: this.sketchLayer,
      view: this.view,
      creationMode: 'single',
});

this.sketch.create('polygon');

 

  • When using the DistanceMeasurement2D. The error occurs when the measurement is completed. 

 

const widget = new DistanceMeasurement2D({ view: this.props.view });
widget.viewModel.unit = this.state.currentMeasurementUnit;
widget.viewModel.mode = 'geodesic';
widget.viewModel.newMeasurement();

 

 

Uncaught (in promise) TypeError: Cannot read property 'items' of null
at g.P._getGraphicsToUpdate (mapViewDeps.js:685)
at g.P._updateGraphics (mapViewDeps.js:686)
at g.P._updateGraphics (mapViewDeps.js:689)

Any idea how i can fix it?

Thanks

Jerome

0 Kudos
1 Reply
by Anonymous User
Not applicable

Hello,
Would you be able to provide a reproducible codepen? 
I tried the workflow with the Sketch widget you provided, and could not reproduce the issue in 4.18.
Take a look at this codepen:
https://codepen.io/banuelosj/pen/QWdmEMb?editors=1000

0 Kudos