bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Better error message for mismatched handle types

Open JMS55 opened this issue 2 years ago • 0 comments

I've seen a couple of users run into errors like these:

Requested handle of type TypeId { t: 201640482042465126479302603612250925020 } for asset 'ship.gltf' does not match actual asset type 'bevy_gltf::Gltf', which used loader 'bevy_gltf::loader::GltfLoader'

assertion left == right failed: The target AssetId<bevy_scene::scene::Scene>'s TypeId does not match the TypeId of this UntypedAssetId left: TypeId { t: 27553811827391490898130069402547565260 } right: TypeId { t: 189582940862555916391852589716973810489 }

What's happening is they load a whole GLTF file or scene and try to use it somewhere a single Handle<Mesh> is expected, instead of loading the mesh subasset of the GLTF file.

We should improve these error messages to ask users to double check what type of asset is expected.

JMS55 avatar Jan 15 '24 05:01 JMS55