Your First Sui dApp - error[E02004] when building the package

Hi there,
I’m new to Sui and I’m getting my feet wet with some basic tutorials.

Some info:

  • version: sui 1.27.0-e5f080922d56-dirty
  • I’m using testnet
  • Windows

I followed the following tutorial: /guides/developer/first-app but I’m running into some issues when building the package.

I get the following error:

sui move build
FETCHING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING my_first_package
error[E02004]: invalid 'module' declaration
    ┌─ C:\Users\me/.move\https___github_com_MystenLabs_sui_git_framework__testnet\crates\sui-framework\packages\move-stdlib\sources\vector.move:241:74
    │
241 │     public macro fun find_index<$T>($v: &vector<$T>, $f: |&$T| -> bool): Option<u64> {
    │                                                                          ^^^^^^^^^^^ 'std::option' uses 'std::vector'. This 'use' relationship creates a dependency cycle.
    │
    ┌─ C:\Users\me/.move\https___github_com_MystenLabs_sui_git_framework__testnet\crates\sui-framework\packages\move-stdlib\sources\option.move:49:9
    │
 49 │         &t.vec[0]
    │         --------- 'std::vector' uses 'std::option'

Failed to build Move modules: Compilation error. 

The tutorial mentions:

If the build fails, you can use the verbose error messaging in output to troubleshoot and resolve root issues.

However, I can’t seem to figure out how to do that :slight_smile:

Please mind I’m just an amateur :wink:
I looked over here on the forum but couldn’t find anything related.

Any help would be appreciated.

Thanks

1 Like

I’m having the same error.

Its like “hello, world” official tutorial (“Your first SUI dAPP”) , and is expected to work.

Version: sui 1.29.2-homebrew
Platform : Mac OS 17

Issue went away , after I uninstalled and installed ui.
“sui move build” worked.

I also encountered the same error. Here is what I did to resolve. It was on version 1.29 which got upgraded to 1.30. You have to update SUI using the following command:

cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui

This will take approximately 20-30 minutes to upgrade. 
Check the sui version after installation - it will be  sui 1.30.3-d355d9f2f8ef.
Check for which sui. This path should be there in the $PATH variable. 

Now run sui move build 

If you are running Windows / Linux / MacOS x86_64 or MacOS ARM, just download the binaries Releases · MystenLabs/sui · GitHub instead of building from source.