OffchainLabs / OffchainLabs/arbitrum-docs

`cargo stylus new` panics when stylus-sdk is not discoverable

Open
#3,003 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
252
Forks
453
Avg merge
3d 2h
Merged PRs (30d)
27

Description

Description

While trying to create a new Stylus project using cargo stylus new, the command panics if the stylus-sdk package cannot be located, without providing a user-facing error message or guidance on how to resolve the issue.

Since this is typically the first command a new developer runs, the panic makes it difficult to understand what prerequisite is missing or how to proceed.


Steps to Reproduce
  1. Ensure cargo-stylus is installed

  2. Run:

    cargo stylus new example
    
  3. Observe the panic during project creation


Observed Behavior

The command panics with the following error:

thread 'main' panicked at ... stylus_sdk.rs:51:10:
Finding stylus-sdk package

No actionable information is provided about:

  • where stylus-sdk is expected to be found
  • whether it is missing, misconfigured, or version-incompatible
  • how the user should resolve the issue

Expected Behavior

Instead of panicking, the tool could:

  • surface a clear error message indicating that stylus-sdk is missing or not discoverable
  • document the requirement explicitly before project creation
  • or provide guidance on how to install or configure the dependency

Environment
  • OS: Windows (via WSL2 / Ubuntu)
  • Rust version: 1.92.0
  • cargo-stylus version: 0.10.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with cargo stylus new example in the stated environment, then inspect the stylus_sdk.rs:51:10 path used during project creation. Trace how an undiscoverable stylus-sdk package is handled and add a user-facing error or guidance instead of a panic; done means the command reports the missing or misconfigured dependency clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.