# Terrain loading problem Cesium world terrain

**URL:** <https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372>\
**Category:** CesiumJS\
**Created:** [November 6, 2024, 10:10pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372 "2024-11-06T22:10:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tstritch1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tstritch1/32/14037_2.png) [@tstritch1](https://community.cesium.com/u/tstritch1)\
**Post date:** [November 6, 2024, 10:10pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/1 "2024-11-06T22:10:44Z")

</div>

It seems basic and of all the tutorials, none of the exact lines work as intended. I can’t get World Terrain to render in a custom application. The difference of one line of code (to set it initially in Viewer or not) renders a white screen instead of the globe. I am able to stream Bing imagery so I don’t think it’s a firewall setting. It throws the error also attached. Looking for suggestions. The “setTerrain” function generates a similar error.

 ![Cesium_BadTerrain](https://global.discourse-cdn.com/cesium/original/3X/5/d/5d4583b31262441336fdb4b2a008007ea5ce0446.png)  
 ![Cesium_codeSnip](https://global.discourse-cdn.com/cesium/original/3X/5/f/5fefcb37cc135597bcff5dbbd5512843097990b0.png)  
 ![Cesium_Ellipsoid.PNG](https://global.discourse-cdn.com/cesium/original/3X/0/1/012e349d0ccf86b0047364a1cb035cf8c62d072e.jpeg)  
 ![Cesium_errorMessage](https://global.discourse-cdn.com/cesium/original/3X/9/b/9bff59f40817953ea379f5d99c31ea838d66e3fa.png)

---

<div class="post-metadata">

**Author:** ![Luke\_McKinstry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/luke_mckinstry/32/25557_2.png) [@Luke\_McKinstry](https://community.cesium.com/u/Luke_McKinstry)\
**Post date:** [November 7, 2024, 6:24pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/2 "2024-11-07T18:24:32Z")

</div>

Hi @tstritch1,  
Thank you for your post and being a part of the Cesium community.

Sorry to hear you are having trouble loading Cesium World Terrain into your application. The error message you tried to post is partially obscured, can you post a full version (posting a screenshot image or copy/pasting the text is fine)?

Seeing the error should help us narrow down the origin of the issue you are experiencing.

Thanks,  
Luke

---

<div class="post-metadata">

**Author:** ![tstritch1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tstritch1/32/14037_2.png) [@tstritch1](https://community.cesium.com/u/tstritch1)\
**Post date:** [November 7, 2024, 7:03pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/3 "2024-11-07T19:03:21Z")

</div>

![Cesium_errorMessage](https://global.discourse-cdn.com/cesium/original/3X/9/b/9bff59f40817953ea379f5d99c31ea838d66e3fa.png)

Uncaught TypeError: Cannot read properties of undefined (reading ‘fromWorldTerrain’)  
at GlobalVariables.js:398:29

---

<div class="post-metadata">

**Author:** ![Luke\_McKinstry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/luke_mckinstry/32/25557_2.png) [@Luke\_McKinstry](https://community.cesium.com/u/Luke_McKinstry)\
**Post date:** [November 7, 2024, 8:03pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/4 "2024-11-07T20:03:36Z")

</div>

Thanks for sharing, @tstritch1 .  
It sounds like your issues may be due to project setup and imports.  
What is the general set up of you project in terms of package manager, build tooling, etc? Are you using tools like for example webpack, Vite, etc or other ? That should help us further narrow down and get you the help resources you need.  
Thanks,  
Luke

---

<div class="post-metadata">

**Author:** ![tstritch1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tstritch1/32/14037_2.png) [@tstritch1](https://community.cesium.com/u/tstritch1)\
**Post date:** [November 7, 2024, 8:40pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/5 "2024-11-07T20:40:40Z")

</div>

It’s a pretty Vanilla setup which is part of why I can’t figure out what is wrong. I’m not using any tools, just have the cesium directory in a project one directory parallel to my html file.

Here’s the code to run the server:

```auto
import http.server
from http.server import HTTPServer,SimpleHTTPRequestHandler
import ssl
shttprhd=SimpleHTTPRequestHandler
shttprhd.extensions_map={
    '.manifest': 'text/cache-manifest',
    '.html': 'text/html',
    '.png': 'image/png',
    '.jpg': 'image/jpg',
    '.crn': 'image/crn',
    '.ktx': 'image/ktx',
    '.css': 'text/css',
    '.glsl':'text/plain',
    '.js': 'application/javascript',
    '.json': 'application/json',
    '.czml': 'application/json',
    '.geojson': 'application/json',
    '.topojson': 'application/json',
    '.wasm': 'application/wasm',
    '.xml': 'application/xml',
    '.b3dm': 'application/octet-stream',
    '.pnts': 'application/octet-stream',
    '.i3dm': 'application/octet-stream',
    '.cmpt': 'application/octet-stream',
    '.geom': 'application/octet-stream',
    '.vctr': 'application/octet-stream',
    '.gltf': 'model/gltf+json',
    '.bgltf': 'model/gltf-binary',
    '.glb': 'model/gltf-binary',
    '':'application/javascript'
}

httpd= HTTPServer(('localhost',8280),shttprhd)
# httpd.socket= ssl.wrap_socket(httpd.socket,certfile='./server.pem',server_side=True)
httpd.serve_forever()

```

And the code to launch the browser and html:

```auto
@start /max /w chrome "http://localhost:8280/hwil/hwil_live.html?server=localhost"

```

And an image of the code structure in VSCode

 ![Cesium_Project](https://global.discourse-cdn.com/cesium/original/3X/1/a/1a6a61faa38ec5a1211fe374d9a6e3a19c6f3c95.png)

---

<div class="post-metadata">

**Author:** ![Luke\_McKinstry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/luke_mckinstry/32/25557_2.png) [@Luke\_McKinstry](https://community.cesium.com/u/Luke_McKinstry)\
**Post date:** [November 7, 2024, 8:42pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/6 "2024-11-07T20:42:07Z")

</div>

Hi @tstritch1 ,  
Before we take a look at what you provided, can you also share what version of Cesium you are using? If you are on an older version there may have been breaking api changes.

Thanks,  
Luke

---

<div class="post-metadata">

**Author:** ![tstritch1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tstritch1/32/14037_2.png) [@tstritch1](https://community.cesium.com/u/tstritch1)\
**Post date:** [November 7, 2024, 8:53pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/7 "2024-11-07T20:53:02Z")

</div>

Looks like 1.101.0. I can update if we think that’s the issue.

---

<div class="post-metadata">

**Author:** ![Luke\_McKinstry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/luke_mckinstry/32/25557_2.png) [@Luke\_McKinstry](https://community.cesium.com/u/Luke_McKinstry)\
**Post date:** [November 7, 2024, 11:19pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/8 "2024-11-07T23:19:27Z")

</div>

1.101.0 is almost 2 years old, so it’s highly likely upgrading will fix the issue.

---

<div class="post-metadata">

**Author:** ![tstritch1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tstritch1/32/14037_2.png) [@tstritch1](https://community.cesium.com/u/tstritch1)\
**Post date:** [November 7, 2024, 11:56pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/9 "2024-11-07T23:56:49Z")

</div>

Well the update definitely helped but I have some different weird behavior now. It stopped loading the imagery. Is that something that might have updated? I don’t get an error message like I did previously for the terrain I just see this:

 ![Cesium_Updated.PNG](https://global.discourse-cdn.com/cesium/original/3X/b/b/bb9fa1aa63bff4d2484f0461a564b229bb9d720b.jpeg)

I think the terrain is loaded and hard to tell because the imagery isn’t on top of it.

---

<div class="post-metadata">

**Author:** ![Luke\_McKinstry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/luke_mckinstry/32/25557_2.png) [@Luke\_McKinstry](https://community.cesium.com/u/Luke_McKinstry)\
**Post date:** [November 8, 2024, 8:25pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/10 "2024-11-08T20:25:12Z")

</div>

Hi @tstritch1 ,

There have been some breaking api changes since 1.101.0 which will require updating your code.

Looking at the file you shared in your original post, I see you are passing the `imageryProvider` option to `Viewer`. This was depreciated in the 1.107.0 release so now you should use `baseLayer` instead. [cesium/CHANGES.md at main · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/blob/main/CHANGES.md#1107---2023-07-03)

That is the main issue I see in your code with respect to api changes in newer version of Cesium. Any additional deprecations to the public API will also be listed in the `CHANGES.md` file linked above.

Hope that helps and please let us know if you have further questions.  
Best,  
Luke

---

<div class="post-metadata">

**Author:** ![tstritch1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tstritch1/32/14037_2.png) [@tstritch1](https://community.cesium.com/u/tstritch1)\
**Post date:** [November 11, 2024, 3:44pm UTC](https://community.cesium.com/t/terrain-loading-problem-cesium-world-terrain/36372/11 "2024-11-11T15:44:54Z")

</div>

Great, that worked. It’s a little confusing since the tutorials haven’t been updated but I suppose there are more of those than are easy to modify every time the API is changed. Thanks for your help!
