Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example frontend-template fails with cargo backtrace #1293

Closed
davidwalter0 opened this issue Mar 28, 2024 · 1 comment
Closed

example frontend-template fails with cargo backtrace #1293

davidwalter0 opened this issue Mar 28, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@davidwalter0
Copy link

davidwalter0 commented Mar 28, 2024

What version are you using?

soroban version
soroban 20.3.1 (ae5446f63ca8a275e61912019199254d598f3bd5)
soroban-env 20.2.1 (18a10592853d9edf4e341b565b0b1638f95f0393)
soroban-env interface version 85899345920
stellar-xdr 20.1.0 (8b9d623ef40423a8462442b86997155f2c04d3a1)
xdr curr (b96148cd4acc372cc9af17b909ffe4b12c43ecb6)
 cargo version
cargo 1.77.0 (3fe68eabf 2024-02-29)
 node --version
v21.6.1

What did you do?

Initialized a directory with hello world and incement then ran

soroban contract init ./  --frontend-template https://github.com/AhaLabs/soroban-astro-template
ℹ️  Initializing project at ./
...

thread 'main' panicked at ${HOME}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-cli-20.3.1/src/commands/contract/init.rs:407:49:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What did you expect to see?

Expected a successful initializaton

What did you see instead?

Failed initialization

$ mkdir api

$ cd api

$ soroban contract init getting-started-tutorial
ℹ️  Initializing project at getting-started-tutorial
➕  Writing getting-started-tutorial/.gitignore
➕  Writing getting-started-tutorial/Cargo.lock
➕  Writing getting-started-tutorial/Cargo.toml
➕  Writing getting-started-tutorial/README.md

$ ls -al
total 12
drwxrwxr-x 3 david david 4096 Mar 28 09:01 .
drwxrwxr-x 7 david david 4096 Mar 28 09:01 ..
drwxrwxr-x 2 david david 4096 Mar 28 09:01 getting-started-tutorial

$ cd getting-started-tutorial/

$ ls
Cargo.lock  Cargo.toml  README.md

$ soroban contract init hello-soroban
ℹ️  Initializing project at hello-soroban
➕  Writing hello-soroban/.gitignore
➕  Writing hello-soroban/Cargo.lock
➕  Writing hello-soroban/Cargo.toml
➕  Writing hello-soroban/README.md

$ ls -al
total 64
drwxrwxr-x 3 david david  4096 Mar 28 09:01 .
drwxrwxr-x 3 david david  4096 Mar 28 09:01 ..
-rw-rw-r-- 1 david david 37912 Mar 28 09:01 Cargo.lock
-rw-rw-r-- 1 david david   458 Mar 28 09:01 Cargo.toml
-rw-rw-r-- 1 david david    96 Mar 28 09:01 .gitignore
drwxrwxr-x 2 david david  4096 Mar 28 09:01 hello-soroban
-rw-rw-r-- 1 david david   976 Mar 28 09:01 README.md

$ soroban contract init ./ --with-example increment
ℹ️  Initializing project at ./
ℹ️  Skipped creating ./.gitignore as it already exists
ℹ️  Skipped creating ./Cargo.lock as it already exists
➕  Writing ./Cargo.toml
ℹ️  Skipped creating ./README.md as it already exists
ℹ️  Initializing example contract: increment
➕  Writing ./contracts/increment/Cargo.toml
➕  Writing ./contracts/increment/Cargo.lock
➕  Writing ./contracts/increment/src/lib.rs
➕  Writing ./contracts/increment/src/test.rs

$ mv hello-soroban/ contracts/

$ ls -al
total 64
drwxrwxr-x 3 david david  4096 Mar 28 09:02 .
drwxrwxr-x 3 david david  4096 Mar 28 09:01 ..
-rw-rw-r-- 1 david david 37912 Mar 28 09:01 Cargo.lock
-rw-rw-r-- 1 david david   458 Mar 28 09:02 Cargo.toml
drwxrwxr-x 4 david david  4096 Mar 28 09:02 contracts
-rw-rw-r-- 1 david david    96 Mar 28 09:01 .gitignore
-rw-rw-r-- 1 david david   976 Mar 28 09:01 README.md

$ git init
Initialized empty Git repository in ${HOME}/work/api/getting-started-tutorial/.git/

$ git add .

$ git commit -a -m 'initial commit'
[main (root-commit) eeb7993] initial commit
 12 files changed, 4678 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Cargo.lock
 create mode 100644 Cargo.toml
 create mode 100644 README.md
 create mode 100644 contracts/hello-soroban/.gitignore
 create mode 100644 contracts/hello-soroban/Cargo.lock
 create mode 100644 contracts/hello-soroban/Cargo.toml
 create mode 100644 contracts/hello-soroban/README.md
 create mode 100644 contracts/increment/Cargo.lock
 create mode 100644 contracts/increment/Cargo.toml
 create mode 100644 contracts/increment/src/lib.rs
 create mode 100644 contracts/increment/src/test.rs

$ soroban contract init ./  --frontend-template https://github.com/AhaLabs/soroban-astro-template
ℹ️  Initializing project at ./
ℹ️  Skipped creating ./.gitignore as it already exists
ℹ️  Skipped creating ./Cargo.lock as it already exists
➕  Writing ./Cargo.toml
ℹ️  Skipped creating ./README.md as it already exists
ℹ️  Initializing with frontend template
ℹ️  Skipped creating ./Cargo.toml as it already exists
➕  Writing ./astro.config.mjs
➕  Writing ./.env.example
➕  Writing ./initialize.js
➕  Writing ./public/favicon.svg
➕  Writing ./tsconfig.json
ℹ️  Skipped creating ./README.md as it already exists
➕  Writing ./package.json
ℹ️  Skipped creating ./Cargo.lock as it already exists
➕  Writing ./src/env.d.ts
➕  Writing ./src/layouts/Layout.astro
➕  Writing ./src/components/Card.astro
➕  Writing ./src/contracts/util.ts
➕  Writing ./src/pages/index.astro
➕  Writing ./CONTRIBUTING.md
➕  Writing ./.gitattributes
➕  Writing ./packages/.gitkeep
➕  Writing ./package-lock.json
thread 'main' panicked at ${HOME}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-cli-20.3.1/src/commands/contract/init.rs:407:49:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@davidwalter0 davidwalter0 added the bug Something isn't working label Mar 28, 2024
@janewang janewang transferred this issue from stellar/stellar-docs Apr 25, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DevX Apr 25, 2024
@janewang janewang moved this from Backlog to Todo in DevX Jun 18, 2024
@elizabethengelman
Copy link
Contributor

Thanks for reporting this!

This was resolved as of release v20.3.4, specifically in this PR: #1224. I've tested this out with v20.3.4 and the most recent release (21.0.0) and was not able to reproduce this error on those releases.

@github-project-automation github-project-automation bot moved this from Todo to Done in DevX Jun 20, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Dev Docs Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Status: Done
Development

No branches or pull requests

2 participants