1

Using anchor version 0.26.0. Steps I took:

  1. anchor init test && cd test
  2. anchor build

Result:

error[E0425]: cannot find function `is` in this scope

I did not make any changes to anything generated by anchor build. This is the default code:

use anchor_lang::prelude::*;

declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");

#[program]
pub mod test {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Initialize {}

This is the default Cargo.toml file:

[package]
name = "test"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "test"

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.26.0"

I get no errors If I switch to version 0.24.2 and repeat the steps above, but I want to use 0.26.0. How can I solve the error above?

Some additional info:

  • OS: macOS Ventura 13.1
  • rustc version: 1.66.0
5
  • Could you edit your question and share your code, or other code that produces this error?
    – Callum M
    Commented Jan 23, 2023 at 14:38
  • I will update my question, however this is without writing any code - the default program fails out of the box.
    – leotron
    Commented Jan 23, 2023 at 14:39
  • Hmm got you. I'd open an issue on the Anchor repo (github.com/coral-xyz/anchor/issues) because it's obviously not an issue with your code. It'd be worth trying on 0.25.0 as well, just because that'll narrow where the issue was introduced to one version. And also I'd mention your Rust version and OS version in the issue, because it's probably something to do with your environment causing the issue.
    – Callum M
    Commented Jan 23, 2023 at 15:14
  • 1
    Looks like the problem was that I used an outdated version of solana. Not sure if it's still worth to open an issue.
    – leotron
    Commented Jan 23, 2023 at 16:24
  • 1
    Got you, glad it's sorted! They won't support old versions so no need to open an issue :)
    – Callum M
    Commented Jan 23, 2023 at 17:47

1 Answer 1

4

Looks like the error was due to an old version of solana that I installed a while ago.

The error disappeared after I updated my solana version from 1.9.28 to 1.14.13.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.