DEV Community

Discussion on: The Complete Guide to Full Stack Solana Development with React, Anchor, Rust, and Phantom

Collapse
 
mrslappy profile image
mrslappy • Edited

Hey there, thanks for your guide

I seem to be having an issue running the tests from the hello world project. Whenever I run anchor test I get the following error:

Transaction simulation failed: Attempt to load a program that does not exist

anchor.workspace is an empty object when running the test.

Hoping you can help me solve this as I cannot find anything about this anywhere

Collapse
 
girrihere profile image
Girri Palaniyapan
  1. When running the test, check the programID on the CLI.
  2. Fill that programID inside lib.rs: declare_id!("INSERT_PROGRAM_ID");
  3. Fill that programID inside the anchor.toml file as well.

This fixed the bug for me

Collapse
 
digitalfuturestold profile image
Mike Heavers

How do you check the programID on the CLI?

Collapse
 
kunkka0822 profile image
Kunkka0822

Hello.

In my experience, you should deploy program before testing. Please run "anchor deploy" before "anchor test".
When deploying, you should set program id. I hope my experience help you. Happy coding!