Our ArcGIS Portal has WMTS Maps. We'd like to switch them using Basemap gallery widget. But when you do so it throws error "TypeError: this.tileInfo.spatialReference.toJson is not a function", however everything works fine with ESRI Map Service layers.
I added a sample which demonstrates this issue.
Thanks in advance.