Skip to content

[BUG]: ReferenceError: Cannot access 'SwankyCommand' before initialization #226

@serendipity-seeker

Description

@serendipity-seeker

What happened?

In swanky cli version 4, I am getting this sort of error.

$ npm i -g @astar-network/swanky-cli@4
$ swanky node start
ReferenceError: Cannot access 'SwankyCommand' before initialization

If I build swanky node with rust in local, it worked. But some swanky commands not works when npm install.
I downgraded swanky version to 3, and it worked very well.
And official docs all written by version 3, I didn't noticed it at all first time so it was so strange for difference of cli and official docs.

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Same working behavior with version 3.

Actual behavior

ReferenceError: Cannot access 'SwankyCommand' before initialization

Environment

  • Ubuntu 22.04
  • Project version/tag: @astar-network/swanky-cli/4.0.0 linux-x64 node-v24.1.0
  • Rust version rustc 1.89.0-nightly (6f6971078 2025-05-28)
  • Node version v24.1.0

Logs, Errors, Screenshots

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions