Closed megatunger closed 1 month ago
usize
and VecDeque
types are not supported in the IDL spec. The reason it used to work before 0.30.0
is because IDL generation would just make everything unknown as a defined type, which resulted in build succeeding but also with an unusable IDL. You can verify this by building your program with 0.29.0
and try to use that IDL client side.
You can, however, include any type in the IDL if you implement IdlBuild
trait for that type. See "Customization" section of https://github.com/coral-xyz/anchor/pull/2824 and this example.
Thanks for you explaination!
I could not build the program since upgrade to Anchor 0.30. It happened if I try to add a field with
usize
orVecDeq
type in struct. Here is a simple replication of this issueOld: Anchor 0.29.0, Solana 1.18.14 -> working
New: Anchor 0.30.0, Solana 1.18.14 -> not working
List of errors:
error[E0599]: no function or associated item named
insert_types
found for structVecDeque
in the current scope error[E0599]: no function or associated item namedinsert_types
found for typeusize
in the current scope error[E0599]: no function or associated item namedcreate_type
found for structVecDeque
in the current scope error[E0599]: no function or associated item namedget_full_path
found for structusize
in the current scope error[E0599]: no function or associated item namedget_full_path
found for structVecDeque
in the current scope