createOpenStreetMap throws a TypeError

I am using:

var osm = new Cesium.createOpenStreetMapImageryProvider({
        url : '[https://a.tile.openstreetmap.org/](https://a.tile.openstreetmap.org/)'
      });
      this.viewer.imagerLayers.addImageryProvider(osm)

I am getting the following error:

ERROR TypeError: Cesium.createOpenStreetMapImageryProvider is not a constructor

Hi,

Try

const osm = new Cesium.OpenStreetMapImageryProvider({
    url : 'https://a.tile.openstreetmap.org/'
});

See OpenStreetMapImageryProvider - Cesium Documentation