# Show/hide layer problem: Cannot read property 'imagery' of undefined

**URL:** <https://community.cesium.com/t/show-hide-layer-problem-cannot-read-property-imagery-of-undefined/1744>\
**Category:** CesiumJS\
**Created:** [December 9, 2014, 4:47pm UTC](https://community.cesium.com/t/show-hide-layer-problem-cannot-read-property-imagery-of-undefined/1744 "2014-12-09T16:47:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashley\_Mort](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ashley_mort/32/8527_2.png) [@Ashley\_Mort](https://community.cesium.com/u/Ashley_Mort)\
**Post date:** [December 9, 2014, 4:47pm UTC](https://community.cesium.com/t/show-hide-layer-problem-cannot-read-property-imagery-of-undefined/1744/1 "2014-12-09T16:47:21Z")

</div>

Whenever I update the visibility of my layers, I am occasionally getting the following error which effectively kills my globe. Does anyone have any tips on troubleshooting this error? I am having trouble determining exactly what is causing it as it doesn’t happen all the time. I am on Cesium 1.1. Thanks!

TypeError: Cannot read property ‘imagery’ of undefined

at ImageryLayer.\_createTileImagerySkeletons (Cesium.js:111978)

at Cesium.js:113126

at QuadtreePrimitive.forEachLoadedTile (Cesium.js:114694)

at GlobeSurfaceTileProvider.\_onLayerAdded (Cesium.js:113125)

at GlobeSurfaceTileProvider.\_onLayerShownOrHidden (Cesium.js:113177)

at Event.raiseEvent (Cesium.js:4409)

at ImageryLayerCollection.\_update (Cesium.js:114055)

at GlobeSurfaceTileProvider.beginUpdate (Cesium.js:112792)

at QuadtreePrimitive.update (Cesium.js:114722)

at Globe.update (Cesium.js:115953)

---

<div class="post-metadata">

**Author:** ![Mark\_Erikson](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mark_erikson/32/2024_2.png) [@Mark\_Erikson](https://community.cesium.com/u/Mark_Erikson)\
**Post date:** [December 9, 2014, 6:11pm UTC](https://community.cesium.com/t/show-hide-layer-problem-cannot-read-property-imagery-of-undefined/1744/2 "2014-12-09T18:11:43Z")

</div>

That’s a bug that was fixed in Cesium 1.3, per this thread: [https://groups.google.com/forum/#!topic/cesium-dev/DuCm67uiy6A](https://groups.google.com/forum/#!topic/cesium-dev/DuCm67uiy6A)

Upgrading should resolve it.

---

<div class="post-metadata">

**Author:** ![Ashley\_Mort](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ashley_mort/32/8527_2.png) [@Ashley\_Mort](https://community.cesium.com/u/Ashley_Mort)\
**Post date:** [December 9, 2014, 11:18pm UTC](https://community.cesium.com/t/show-hide-layer-problem-cannot-read-property-imagery-of-undefined/1744/3 "2014-12-09T23:18:02Z")

</div>

Sweet. Moving to 1.2 seems to fix it for me. Thanks!

That thread references a fix in 1.3 then later says it was actually fixed in 1.2.
