CesiumGS / cesium

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

Error: Uncaught (in promise): [object Undefined] #11991

Closed lmarcelocc closed 4 weeks ago

lmarcelocc commented 4 weeks ago

What happened?

Same as discussed here.

Error: Uncaught (in promise): [object Undefined]
scheduleMacroTaskWithCurrentZone | @ | zone.umd.js:724
  | (anonymous) | @ | zone.umd.js:2465
  | proto. | @ | zone.umd.js:1017
  | render_ | @ | OLCesium.js:209
  | onAnimationFrame_ | @ | OLCesium.js:250
  | timer | @ | zone.umd.js:2441
  | _ZoneDelegate.invokeTask | @ | zone.umd.js:445
  | (anonymous) | @ | core.mjs:10757
  | onInvokeTask | @ | core.mjs:10757
  | _ZoneDelegate.invokeTask | @ | zone.umd.js:444
  | onInvokeTask | @ | core.mjs:11070
  | _ZoneDelegate.invokeTask | @ | zone.umd.js:444
  | Zone.runTask | @ | zone.umd.js:210
  | ZoneTask.invokeTask | @ | zone.umd.js:527
  | ZoneTask.invoke | @ | zone.umd.js:516
  | data.args. | @ | zone.umd.js:2421

Was able to workaround it, but we really should try to see where this unhandled promise is being thrown

Reproduction steps

  1. 3D Tileset
  2. Zoom in and move a little bit fast to perform a lot of requests

Sandcastle example

No response

Environment

Browser: Android CesiumJS Version: 1.117.0 Operating System: Tried with Android 11, 13 and 14

ggetz commented 4 weeks ago

Thanks for the report @lmarcelocc! Would you be able to include a Sandcastle example that replicates the issue? That would help us give us more context to determine the issue.

lmarcelocc commented 4 weeks ago

Hi @ggetz ,

Unfortunately I tried last week to replicate on Sandcastle, with same 3D data, but I was not able to. Probably because, like mentioned here, could be Angular related (zone.js).

ggetz commented 4 weeks ago

Got it, thanks @lmarcelocc. From the discussion, it looks like zone.js is wrapping native promises leading to the adverse behavior. I'm not sure there is much we can do in that situation.

We are generally trying to track down instances of undefined being thrown, as this can cause issues in our unit tests. Hopefully that will fix the issue your seeing as well.

I'm going to close this issue as am not sure there is actionable path beyond what we would do to fix #11958. Let me know if you think otherwise.