Uncaught TypeError: Cannot read property 'createElement' of null

I’m using following code

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Include the CesiumJS JavaScript and CSS files -->
 <script src="https://cesium.com/downloads/cesiumjs/releases/1.84/Build/Cesium/Cesium.js"></script>

 <link href="https://cesium.com/downloads/cesiumjs/releases/1.84/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
</head>
<body>
<div id="cesiumContainer"></div>
<script>
   // Your access token can be found at: https://cesium.com/ion/tokens.

    // Replace `your_access_token` with your Cesium ion access token.
Cesium.Ion.defaultAccessToken = 'XXXXXXXXXXXXXXXXXX';
var viewer = new Cesium.Viewer("cesiumContainer", {
 imageryProvider: Cesium.createWorldImagery({
 style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS,
}),
baseLayerPicker: false,
});
var layers = viewer.scene.imageryLayers;
var blackMarble = layers.addImageryProvider(
new Cesium.IonImageryProvider({ assetId: 3812 })
);
blackMarble.alpha = 0.5;
blackMarble.brightness = 2.0;
</script>
</div>
</body>
</html>

Map is being generated but getting this error in console.

Uncaught TypeError: Cannot read property ‘createElement’ of null
at HTMLIFrameElement. (Cesium.js:1)

Any solution , Thanks

@James

Thank you for the detailed community forum post! I have never encountered this error.

Uncaught TypeError: Cannot read property ‘createElement’ of null
at HTMLIFrameElement. (Cesium.js:1)

I would like to learn a little bit more about how exactly you are causing this error. Could you please share a sandcastle demo that showcases the error? In the meantime, let me know if you have any other questions or concerns. I am not sure if this error is necessarily related to CesiumJS. Rather, it might be a standard HTML error. In that case, stack overflow is also a great resource to use when debugging.

-Sam