As of Cesium 1.17 RectanglePrimitve has been deprecated so this will need to be updated as the Extent primitive can no longer be drawn.