bevyengine / bevyengine/bevy

Better error message for mismatched handle types

Open
#11,354 2 comments 2 reactions 0 assignees View on GitHub
A-Assets C-Docs C-Usability D-Trivial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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'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 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.