My application cease to work when I switched from Cesium 1.76 to 1.81

Dear Cesium users and team!

My application cease to work when I switched from Cesium 1.76 to 1.81. These are the error messages:

Any help would be greatly appreciated.
Sincerely,
Ru

Hi Ru,

Without seeing your source code, it’s difficult to tell what ceased to work.

If you look through the releases list of changes (which can be found here: Releases · CesiumGS/cesium · GitHub), since v1.76, do you see any changes that could lead to the issue you’re facing?

You can also isolate exactly which commit broke the application using Git bisect: Git - git-bisect Documentation. This will help narrow down the change in the API that caused your application to stop working.

1 Like

Dear Dzung!

Thank you very much for your attempt to help me.

Looking through releases from 1.76 to 1.81 I did not found anything that I connect with my problem.

May be I badly understand git bisect documentation. This is citation from it: “This command uses a binary search algorithm to find which commit in your project’s history introduced a bug.” But I did only 1 commit in that I changed the folder “Cesium-1.76/Build/Cesium” on “Cesium-1.81/Build/Cesium”. So I exactly know what commit breaked my code, but cause somewhere inside Cesium.

Do you know how I can go down error mesagge stack trace from the cesiumWorkerBootStrapper to my code and localise thereby a problem place?

Thanks in advance,

Ru

How do you tell Cesium where its assets live? One of the first things I do in my application page is set window.CESIUM_BASE_URL = "./CesiumStatic/". My webpack build copies all of Cesium’s assets (like its worker scripts) into that subdirectory. It’s supposed to have some fallback algorithm to “guess” at the path, but IMHO specifying it explicitly is better.

1 Like

Hi, James!

I didn’t any build. In the beginning I simply copied in my resources/public folder a folder Cesium from the folder Build in the Cesium distribution and adjust references to Cesium in my html and javascript files accordingly. All worked well. Then, when new versions of Cesium were issued, I simply replaced that Cesium folder in resources/public same way. And it worked many times until version 1.80 of Cesium come. I got this error above. I waited for the next version, thought it is a bug, that will be fixed. Alas, the error remains.
What to do I don’t know. Thanks all the same.

Sincerely,
Ru

So when you say “adjust references to Cesium”, could you post that code here? Even better would be a minimal reproduction – just start with a blank page and include Cesium the same way you do in your project, then try to make a basic Viewer. If it has the same error, you can upload that page somewhere easy to get to (like GitHub) which will make it easier to see what’s going wrong.

If that approach isn’t working, you can try replacing the Cesium you’re using with the “unminified” version that’s distributed in the NPM package. It should work the same way as the library you have now but the line numbers in the console message will be more useful in understanding the error.

1 Like

Well, James. In fact, I have found only two references on Cesium code location in my app. Both are in a main and sole html page in this fragment:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Cockpit View</title>
    <link rel="stylesheet" href="css/cesium_light.css" />
    <script src="Cesium/Cesium.js"></script>
    <style>
      @import url(Cesium/Widgets/widgets.css);
      #cesiumContainer {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        margin: 0;
        overflow: hidden;
        padding: 0;
        font-family: sans-serif;
      }
      html {
        height: 100%;
      }
      body {
        padding: 0;
        margin: 0;
        overflow: hidden;
        height: 100%;
      }
    </style>
  </head>

…

Further, Cesium Viewer opens well. Error appears when I call some particular function in my code. Now I whant to envestigate this proces in details, put debug print in some points and thereby limit the search area. Hope this helps. Thank you.

Can you try inserting

<script>window.CESIUM_BASE_URL = "./Cesium/";</script>

just above

<script src="Cesium/Cesium.js"></script>

to see if it makes any difference? Might have no impact, but it doesn’t hurt to try.

1 Like

Bingo! Miracle! James, you are magician!
This simple addition solved a problem and save me a lot of time.
Thank you very much!
Good luck!
Best regards,
Ru

1 Like