coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.59k stars 1.32k forks source link

IDL doesn't exist #2877

Closed jerac-breederdao closed 5 months ago

jerac-breederdao commented 6 months ago

I tried running anchor test and i got the error Error: IDL doesn't exist I already ran cargo clean then cargo build but the error still exist.

acheroncrypto commented 6 months ago

You need to run anchor build instead of cargo build to generate the IDL. Also, anchor test builds the programs by default too, so if you still get this error, it might be because of a mismatch between your program name in various places e.g. Anchor.toml and Cargo.toml.

acheroncrypto commented 5 months ago

To add to the previous post, the latest version (v0.30.0) includes various fixes to the IDL generation workflow, making it very likely that the problem you're having is fixed.