Canister trapped explicitly: Uncaught Error: Cannot find required field signature

I am getting this error:

Call failed:
Canister: [canisterId]
Method: getInfo (query)
"Status": "rejected"
"Code": "CanisterError"
"Message": "IC0503: Canister [canisterId] trapped explicitly: Panicked at 'called `Result::unwrap()` on an `Err` value: Uncaught Error: Cannot find required field signature\n at decodeValue (main.js:129294)\n at <anonymous> (main.js:129990)\n at map (native)\n at decode2 (main.js:129991)\n at decodeSingle (main.js:130536)\n at decode3 (main.js:130526)\n at <anonymous> (main.js:131486)\n at map (native)\n at values (main.js:131487)\n at <anonymous> (main.js:132592)\n at executeMethod (main.js:131297)\n at <anonymous> (main.js:131327)\n', canister/src/lib.rs:98:14"

I am calling a simple query function that is in the same format as another query function that is being called just fine. I am writing the canister smart contract in Typescript using Azle.

const Decision = Variant({
    Yes: bool,
    No: bool,
});

const Info = Record({
    id: int8
    decision: Decision,
    signature: text
})

let info = StableBTreeMap(int8, Info, 0);

export default Canister({
...
getInfo: query([], Vec(Info), () => {
        const infoList = info.values();
        return infoList;
    }),
...
})

What could be the cause of this error?

2 Likes

Pinging @lastmjs since this is about Azle

1 Like

Can you send more code? I wonder if the values you have inserted are incorrect somehow

1 Like