call getter function return Unsupported item type: tvm.stackEntrySlice
Why does this simple getter function always return an Unsupported item type? I also tested common types like String, and Int but only on returning structs have error.
get fun query(index: Int): Order? {
return self.orders.get(index);
}
the client app call using tonClient
query: () => {
console.log(contract?.getQuery(BigInt(1)));
}
can you also share your Order's struct please? did you have any unsized Int property in the struct? If so, please retry with assigned bit size to your Int
struct Order {
query_id: Int? as uint64 = null;
product_id: Int? as uint256 = null;
}
can you also share your
Order's struct please? did you have any unsizedIntproperty in the struct? If so, please retry with assigned bit size to yourIntstruct Order { query_id: Int? as uint64 = null; product_id: Int? as uint256 = null; }
Seem issue for me
struct OrderInfo {
buyer: Address;
amount: Int as coins;
orderId: Int;
time: Int as uint64;
}
``` my Struct
same question , when I get a struct of order, I will get same Error.
but if I get a map of order. it's normal.
I also encountered this issue, and it appeared to be a problem of @ton/ton on the client side. I hope that my fix will be merged soon.
I've also faced this Issue, but due to no progress on library's code, I had to wrote polyfill to this issue.
The main problem, as the name of error says, that type tvm.stackEntrySlice is not supported, but if one replace it with tvm.stackEntryCell, everything would work.
This is dirty hack, which overrides global XMLHttpRequest, and fixes response text the way that library understands. Its not perfect, but works in my case, maybe in yours would also.
You just need to update @ton/ton libbrary to the latest version to solve the issue.