CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.03k stars 3.51k forks source link

UrlTemplateImageryProvider broken after upgrade from 1.91 to 1.92+ #11077

Closed arye97 closed 1 year ago

arye97 commented 1 year ago

Upgrading from CesiumJS 1.91 to 1.92+ causes jest tests to be unable to invoke the UrlTemplateImageryProvider constructor, the returned object is empty (all default values) when on 1.91 and lower it was populated.

Running in debugger we can see there is a stack trace error now which gives Error: STACKTRACE TRACKING at getStacktraceWithUncaughtError (__project-path__\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:3573:16)

However other constructors such as new Cesium.Resource(options) works perfectly fine, so I believe this is just something wrong with UrlTemplateImageryProvider.

We are using Angular 13, typescript 4.4.3, cesium 1.92 (error actually found at v1.101.0 then we rolled back) and jest 29.

To recreate, using CesiumJS 1.92 or higher and angular 13, create an angular component and then method which uses the new Cesium.UrlTemplateImageryProvider(options) constructor, then test this method in a jest test and see that the object returned has all default values, not taking on any attributes passed in such as resource new Cesium.Resource(options).

Thanks for any help :)

There is an error message that I can get through the debugger - this does not cause an app crash but the object remains unpopulated.

TypeError: Cannot read properties of undefined (reading 'length') at Object.get (__project-path__\node_modules\cesium\Build\CesiumUnminified\index.cjs:26966:30) at Object.<anonymous> (<anonymous>:1:26)

Sandcastle example:

Browser: Chrome

Operating System: Windows

ggetz commented 1 year ago

Hi @arye97, I'm not able to reproduce this in Sandcastle. Di you have a minimal code example or app configuration which can reproduce this error?

ggetz commented 1 year ago

Closing this as we're troubleshooting it on the forum.