# Old CesiumJS codes no longer work with the new version 1.103

**URL:** <https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218>\
**Category:** CesiumJS\
**Created:** [April 3, 2023, 2:49pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218 "2023-04-03T14:49:15Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 3, 2023, 2:49pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/1 "2023-04-03T14:49:15Z")

</div>

I wanted to update resident CesiumJS on my web server to the new version 1.103.  
Codes that worked for several years and several versions of CesiumJS before and until at least 1.85, does not work anymore. I had to go back to version 1.85 on my server that I had archived. It seems that all my codes with more than 2 input fields are blocking the script.

Example with tiled model:  
[https://bit.ly/329qFEG](https://bit.ly/329qFEG)

Do you have any idea what can happen ? Should I create a issue on github ?

best regards,

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 4, 2023, 7:57am UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/2 "2023-04-04T07:57:01Z")

</div>

version 1.99 does not work either

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 4, 2023, 8:36am UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/3 "2023-04-04T08:36:45Z")

</div>

I made tests by downloading the old versions. The code still works with 1.91 but not with 1.92.

v1.92: [Cesium Releases in April 2022 – Cesium](https://cesium.com/blog/2022/04/01/cesium-releases-in-april-2022/)

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 4, 2023, 1:25pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/4 "2023-04-04T13:25:04Z")

</div>

This _might_ be related to the changes in the promises that is described in more detail at [CesiumJS is switching from when.js to native promises-- Which will be a breaking change in 1.92](https://community.cesium.com/t/cesiumjs-is-switching-from-when-js-to-native-promises-which-will-be-a-breaking-change-in-1-92/17213) .

Could you describe in more detail what it means when you say that the code “does not work anymore”? Do you see rendering artifacts, or nothing rendered at all? Or do you see crashes or error messages in the console (if so: which messages) …? Maybe the CesiumJS core team can give more specific hints based on that, beyond the things that are mentioned in the linked thread.

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 4, 2023, 2:58pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/5 "2023-04-04T14:58:56Z")

</div>

Hello Marco13, In fact, my web page loads but remains blocked on the vision of the Earth globe and does not fly any more towards the tiled model which on the ground of the excavation site. In v 1.91 the FlyTo it still works but in v 1.92 my CesiumJS script doesn’t work like before.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 4, 2023, 3:12pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/6 "2023-04-04T15:12:38Z")

</div>

When looking at your page in Chrome or Firefox, you can press `F12` to open the ‘Developer Tools’ window. There should be a ‘Console’ at the bottom, which may contain an error message (in doubt, you may reload the page and see whether there is any message). If this does not bring any insights, it may be helpful if you showed the code that you are actually using to display your model.

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 4, 2023, 4:23pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/7 "2023-04-04T16:23:36Z")

</div>

excuse me Marco13, I thought you could run it in the old versions. Here is a capture of the console:

Cesium.js:894 options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead.  
Zv @ Cesium.js:894  
Cesium.js:894 Cesium3DTileset constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead.  
Zv @ Cesium.js:894  
Cesium.js:894 Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead.  
Zv @ Cesium.js:894  
OppidumCorentRempartsOuest-ZoneFer20210906-07\_ZoneBronze20210908-09.html:238 Uncaught TypeError: tileset\_zoneB.readyPromise.then(…).otherwise is not a function  
at OppidumCorentRempartsOuest-ZoneFer20210906-07\_ZoneBronze20210908-09.html:238:4  
about:blank:1 Blocked script execution in ‘about:blank’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 4, 2023, 5:35pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/8 "2023-04-04T17:35:12Z")

</div>

The critical part appears to be

> TypeError: tileset\_zoneB.readyPromise.then(…).otherwise is not a function

This corresponds to the instructions that are given [in the linked thread](https://community.cesium.com/t/cesiumjs-is-switching-from-when-js-to-native-promises-which-will-be-a-breaking-change-in-1-92/17213), which says

> In promise chains which originate from the Cesium API, switch to using the Promise API
> 
> - `otherwise` changes to `catch`
> - `always` changes to `finally`

As a first, quick shot, you could look at your source code and search for the function `otherwise`, and change this to `catch`.

(Maybe that’s not the _only_ difference, but it should bring you one step closer towards a state that works with the latest version)

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 5, 2023, 10:40am UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/9 "2023-04-05T10:40:15Z")

</div>

Hi Marco13,  
I replaced all occurrences of “otherwise” by “catch” and everything works as before with the latest version 1.104. Thank you very much for your expertise. I had not seen this advice.  
best regards, David.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 5, 2023, 12:34pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/10 "2023-04-05T12:34:38Z")

</div>

Good to hear that.

You might want to have a look at the other warnings, though. There are some ongoing changes regarding the `options.url` and the `readyPromise` that will be removed in Cesium 1.107. There is a detailed description of the changes in [CesiumJS Ready Promise Deprecation / API Changes](https://community.cesium.com/t/cesiumjs-ready-promise-deprecation-api-changes/22469) . It’s hard to say where and how exactly that will affect _your_ code, but you might want to keep an eye on that.

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 5, 2023, 2:02pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/11 "2023-04-05T14:02:32Z")

</div>

Thanks, Marco13. I will follow these changes in the APIs.

Whil I’ll take the opportunity to ask you if you have an example of sandcode to display a 3D **tiled** model object in space (like spaceship), with a stars background with CesiumJS ? and to be able to rotate around this object without the display of the earth glode ?

best regards, David.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 5, 2023, 2:23pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/12 "2023-04-05T14:23:25Z")

</div>

Here is an example with a function that adjusts the height of a tileset (if this was what the question was about), and a function with a _workaround_ to hide the globe (if this is what the question was about).

> **[Cesium Sandcastle](https://sandcastle.cesium.com/index.html#c=tVRda9swFP0rIuzBhqCktJTRpGGh27rCxmAN24sfKkvXthZZCpKcLC3577u2nNlpPdaXPdn345x77ofNjXaebCXswJJromFHbsDJqqTfG1+UjHhj3xjtmdRgk9GYPCWaEA/WoufqCFgFm2bWlD+MVaJ1RPE40Yd4luhEZ5XmXhpNCingVpkUMHPNrKm0iOLAG8RQx0EDzesc6i3TTlXo4XsKmqUKBKr1toLZayAp4+uPjMNSbQqGwCmdvgqHrWj/T6Bb75e+NG5TgEWrMDvMzJhyA+Iyk/ca+EtSUFIT3TaT6dh7mEOiB4d4OmcmflbOfwKZFz7yUoEDPyZFY7fz5s0JpDVa6vz+WKdNpqeBWYfgzHqTW7YpJMf89gpuet7mFGoHhpiOTpkotoonFPcYXWUzHPYpWYM9b6i+MYHvLqoR5KQ+VUbn0lcCxkNB5vsxXGL90q9ssgx7/d+Fw9if1w4Xx5p1DQlwVYop3LfVg9SWsZ1Ya/W+3g4fxV3B405LI0B9Yd7KX13JYF80Da86TVFPXxzuLtHe7vvH0/IiF9sx6f+IaB7n71dt2Zr5zuilQ+NORBfTt5eXQdjwmZ5Np/HLr2NjZSm93IKjTIhj9knio8EWTD90wMV4XpAI/0nG9i7fKMAd5tHDhzpAlGH1iR47uiJvnhrE4aHtfTQezZ3fK1iEmRPyTpYbYz2prIoonXgoNzgtcJO04mvsmjsXxBEyn/ShcyG3RIrrgV8s4Yo5h5GsUupePkIyWswnmP8C2gr+ugWr2L5OK84Wn4OTUjqfoDmM9MaolNlnzL8B)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Note that hiding the globe like this is a _workaround_ - it should be possible to just create the viewer with the `globe: false` setting. But that is currently causing some issues. (Maybe someone has a better solution…)

---

<div class="post-metadata">

**Author:** ![David\_Romeuf](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/david_romeuf/32/1987_2.png) [@David\_Romeuf](https://community.cesium.com/u/David_Romeuf)\
**Post date:** [April 5, 2023, 5:12pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/13 "2023-04-05T17:12:55Z")

</div>

it’s good for the noglobe Earth, but I would like to turn completely around, to pass underneath (what we can’t in this sandcastle example). My model is not a ground tiled but a space probe starship object for example ISS in 3D tiled…

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 5, 2023, 7:03pm UTC](https://community.cesium.com/t/old-cesiumjs-codes-no-longer-work-with-the-new-version-1-103/23218/14 "2023-04-05T19:03:07Z")

</div>

Then it might be better to ask this in a dedicated thread (with a proper title and goal description), so that more people (particularly the CesiumJS core team) can see it. There are some options for modifying the camera controls. In doubt, you have the complete freedom to implement your own, only using the `Camera`, as shown in the “Camera Tutorial” [Cesium Sandcastle](https://sandcastle.cesium.com/?src=Camera%20Tutorial.html) . But maybe there is already a predefined, simpler way to achieve your goal.
