Cesium Rendering Error When Zooming on Mesh Tileset

I’m encountering an issue in Cesium when I zoom into a loaded tileset, specifically when more detailed tiles are rendered. The tileset I’m working with is “mesh.” When I zoom in, Cesium throws an error and stops rendering. The error message is as follows:

An error occurred while rendering. Rendering has stopped.
TypeError: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
    at loadNodes (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:234430:34)
    at parse (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:234516:17)
    at push.93996.GltfLoader.process (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:233630:5)
    at push.12604.ModelExperimental.update (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:278409:18)
    at push.36248.ModelExperimental3DTileContent.update (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:279142:9)
    at push.62228.Cesium3DTile.process (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:200071:17)
    at processTiles (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:208426:14)
    at push.45534.Cesium3DTileset.prePassesUpdate (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:208289:3)
    at push.1330.PrimitiveCollection.prePassesUpdate (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:308016:17)
    at prePassesUpdate (http://localhost:4200/default-src_app_features_map-view_map-view_module_ts-src_app_features_slides-collection_slide-127fcd.js:317563:14)

Has anyone encountered a similar issue or can provide insights into what might be causing this? Any advice on additional debugging steps or potential fixes would be greatly appreciated.

It can be difficult to figure out the reason for such an error by just looking at the stack trace.

Using an unminimized version of CesiumJS could help as a first step, because then, the stack trace would still contain the line numbers. But from the function names in the stack trace, it looks like there’s something wrong when loading one the glTF assets. And there are not many places where ...length appears in the loadNodes function.

Right now, I don’t see what could be undefined there, but maybe it’s possible to figure that out…

In the meantime, you could consider running the 3d-tiles-validator on your tileset, to see whether it reports any errors.