OffchainLabs / OffchainLabs/arbitrum-docs
`cargo stylus new` panics when stylus-sdk is not discoverable
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
-
Ensure
cargo-stylusis installed -
Run:
cargo stylus new example -
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-sdkis 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-sdkis 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-stylusversion: 0.10.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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