cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.81k stars 2.05k forks source link

double se::Value::toDouble() const: assertion "_type == Type::Number || _type == Type::Boolean || _type == Type::BigInt || _type == Type::String" failed #17015

Open GamewolfLongMan opened 6 months ago

GamewolfLongMan commented 6 months ago

Cocos Creator version

3.8.2

System information

android

Issue description

C:/ProgramData/cocos/editors/Creator/3.8.2/resources/resources/3d/engine/native/cocos/bindings/jswrapper/Value.cpp:451: double se::Value::toDouble() const: assertion "_type == Type::Number || _type == Type::Boolean || _type == Type::BigInt || _type == Type::String" failed get error afte assetManager.loadBundle

Relevant error log output

擷取

Steps to reproduce

some asset get this error some not . I dont know why

Minimal reproduction project

No response

smallmain commented 6 months ago

Encountered the same problem.

smallmain commented 6 months ago

I found the problem was that the data of a certain prefab was corrupted:

    "_lpos": {
      "__type__": "cc.Vec3",
      "x": 0,
      "y": 160,
      "z": 0
    },
    "_lrot": {
      "__type__": "cc.Quat",
      "x": null,
      "y": null,
      "z": null,
      "w": null
    },
    "_lscale": {
      "__type__": "cc.Vec3",
      "x": 1,
      "y": 1,
      "z": 0
    },

_lrot is null, but i don't know why this is happening. The only rotation-related operation I performed on this node was this.node.setWorldRotation(Quat.IDENTITY);

Error data should not be serialized:

After this problem occurs, it is very difficult to debug, and it will be fine without loading. It is a time bomb.

GamewolfLongMan commented 6 months ago

This is not the only one prefab with this problem. one day some prefab get broken and I dont know why

dumganhar commented 6 months ago

It's possible the same issue which was fixed at https://github.com/cocos/cocos-engine/pull/16935 You could try to customize the engine , rebuild the engine and see whether it still exists.