Issues migrating from 1.104 to 1.110.1

Hello,

I’m having some issues when updating the code.I know there are some breaking changes happing already at 1.107.

But I can’t seem to figure out why a simple code snippet like:

function flyToLoc(lat, long, alt){
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(lat, long, alt),
});
};

Won’t run, I spec the coordinates in html with onclick. It just prints “flyToLoc is not defined” in console.
And in other js files (separated per functionality). They just print “viewer is not defined”.

Any help would be appreciated. The application works running the 1.104 version.

Thanks in advance

probably something with script type=module that’s now needed

Yes I have added type=module to the main js file where the the flyToLoc function is.

Hi there,

I think this issue is outside of the function you listed here.

Would you mind telling us more about your build config and how you import Cesium?

Hi Gabby, thanks for taking the time to reply. I have manged to solve the problem. The functions where not accessible in the global scope since I used onclick, now I use:

const citynameLink = document.getElementById(‘cityname’);
citynameLink.addEventListener(‘click’, () => flyToLoc(latnumber, longnumber, altnumber));

And before I used the function in my post, calling it using onclick=“flyToLoc(latnumber, longnumber, altnumber)”.

I will keep this post open untill we are fully migrated, in case if any other problem come up.
/A

To answer your question, we are currently importing cesium via your CDN.
We might use npm and webpack later down the road.

Hey again, we are getting “Error RESULT_CODE_HUNG”. This seem to happen when the user orbits the camera and is or are close to the ground, then everything freezes. Then you get an alert asking if you should wait for the site to respond or close the site. This happens on both Chrome and Edge.

We have not had this issue in CesiumJS before. But we have had it in Cesium Ion e.i. Stories mode. https://community.cesium.com/t/cesium-crashing-heavly-in-storys/24765/4

Have you guys experienced anything like this before?

Interesting, I’m not sure what the exact cause of that may be.

It could be based on the amount of memory the app is using. Would you be able to provide a code snippet, or ion asset IDs that we could use to troubleshoot?

Thanks for your reply,
Code snippet or ion asset ID of what?
The terrain asset?

I don´t know if other people have had this crashing issue in story mode. If not, I´am thinking maybe it could be our custom terrain some how causing this?

Hi Albnas,

A code snippet reproducing the error.

The terrain provider you’re using will be helpful to know. If it is on Cesium ion, you can let us know the Asset ID and we will be able to check the data.

If this is something that is only replicated with a specific camera movement, maybe a video would be helpful?

Hi @Gabby_Getz , thanks for taking your time to reply. Do you have a email I can send the video to? I can’t upload a video here, it is not an allowed format.

/Albin

Hi Albin,

Sure, please send the video to gabby@cesium.com and support@cesium.com.

I have sent emails, but got no response, but I saw now this issue was resolved with the updated to 1.112 ( #11630) I haven’t experinced it any more.

Thanks you guys!