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

Fullstack example auth is panicking #2942

Open
2 tasks
ywiyogo opened this issue Sep 8, 2024 · 2 comments
Open
2 tasks

Fullstack example auth is panicking #2942

ywiyogo opened this issue Sep 8, 2024 · 2 comments
Labels
fullstack related to the fullstack crate needs reproduction An issue that is missing a reproduction

Comments

@ywiyogo
Copy link

ywiyogo commented Sep 8, 2024

Problem
I tried to run the fullstack auth example. But it return errors:

2024-09-08T12:42:11.418Z DEBUG [sqlx::query] summary="PRAGMA foreign_keys = ON; …" db.statement="\n\nPRAGMA foreign_keys = ON;\n" rows_affected=0 rows_returned=0 elapsed=26.28µs elapsed_secs=2.628e-5
2024-09-08T12:42:11.418Z DEBUG [sqlx::query] summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS test_table (\n  \"id\" VARCHAR(128) NOT NULL PRIMARY KEY,\n  \"expires\" INTEGER NULL,\n  \"session\" TEXT NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=194.757µs elapsed_secs=0.000194757
2024-09-08T12:42:11.418Z DEBUG [sqlx::query] summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS users (\n  \"id\" INTEGER PRIMARY KEY,\n  \"anonymous\" BOOLEAN NOT NULL,\n  \"username\" VARCHAR(256) NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=69.8µs elapsed_secs=6.98e-5
2024-09-08T12:42:11.418Z DEBUG [sqlx::query] summary="PRAGMA foreign_keys = ON; …" db.statement="\n\nPRAGMA foreign_keys = ON;\n" rows_affected=0 rows_returned=0 elapsed=11.31µs elapsed_secs=1.131e-5
2024-09-08T12:42:11.419Z DEBUG [sqlx::query] summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS user_permissions (\n  \"user_id\" INTEGER NOT NULL,\n  \"token\" VARCHAR(256) NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=102.031µs elapsed_secs=0.000102031
2024-09-08T12:42:11.419Z DEBUG [sqlx::query] summary="INSERT INTO users (id, …" db.statement="\n\nINSERT INTO\n  users (id, anonymous, username)\nSELECT\n  1,\n  true,\n  'Guest' ON CONFLICT(id) DO\nUPDATE\nSET\n  anonymous = EXCLUDED.anonymous,\n  username = EXCLUDED.username\n" rows_affected=1 rows_returned=0 elapsed=30.535µs elapsed_secs=3.0535e-5
2024-09-08T12:42:11.419Z DEBUG [sqlx::query] summary="INSERT INTO users (id, …" db.statement="\n\nINSERT INTO\n  users (id, anonymous, username)\nSELECT\n  2,\n  false,\n  'Test' ON CONFLICT(id) DO\nUPDATE\nSET\n  anonymous = EXCLUDED.anonymous,\n  username = EXCLUDED.username\n" rows_affected=1 rows_returned=0 elapsed=36.948µs elapsed_secs=3.6948e-5
2024-09-08T12:42:11.419Z DEBUG [sqlx::query] summary="INSERT INTO user_permissions (user_id, …" db.statement="\n\nINSERT INTO\n  user_permissions (user_id, token)\nSELECT\n  2,\n  'Category::View'\n" rows_affected=1 rows_returned=0 elapsed=30.031µs elapsed_secs=3.0031e-5
thread 'main' panicked at packages/fullstack/examples/auth/src/main.rs:52:66:
called `Result::unwrap()` on an `Err` value: UnableToLoadIndex("/home/dioxus/packages/fullstack/examples/auth/dist/public/index.html")
stack backtrace:
   0:     0x61b0a1f469b5 - std::backtrace_rs::backtrace::libunwind::trace::h23054e327d0d4b55
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x61b0a1f469b5 - std::backtrace_rs::backtrace::trace_unsynchronized::h0cc587407d7f7f64
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x61b0a1f469b5 - std::sys_common::backtrace::_print_fmt::h4feeb59774730d6b
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x61b0a1f469b5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd736fd5964392270
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x61b0a1f6e14b - core::fmt::rt::Argument::fmt::h105051d8ea1ade1e
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/rt.rs:165:63
   5:     0x61b0a1f6e14b - core::fmt::write::hc6043626647b98ea
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/mod.rs:1168:21
   6:     0x61b0a1f43b2f - std::io::Write::write_fmt::h0d24b3e0473045db
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/mod.rs:1835:15
   7:     0x61b0a1f4678e - std::sys_common::backtrace::_print::h62df6fc36dcebfc8
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x61b0a1f4678e - std::sys_common::backtrace::print::h45eb8174d25a1e76
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x61b0a1f47cd9 - std::panicking::default_hook::{{closure}}::haf3f0170eb4f3b53
  10:     0x61b0a1f47a7a - std::panicking::default_hook::hb5d3b27aa9f6dcda
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:298:9
  11:     0x61b0a1f48173 - std::panicking::rust_panic_with_hook::h6b49d59f86ee588c
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:795:13
  12:     0x61b0a1f48054 - std::panicking::begin_panic_handler::{{closure}}::hd4c2f7ed79b82b70
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:664:13
  13:     0x61b0a1f46e79 - std::sys_common::backtrace::__rust_end_short_backtrace::h2946d6d32d7ea1ad
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x61b0a1f47d87 - rust_begin_unwind
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5
  15:     0x61b0a1b25a53 - core::panicking::panic_fmt::ha02418e5cd774672
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:72:14
  16:     0x61b0a1b26026 - core::result::unwrap_failed::h55f86ada3ace5ed2
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/result.rs:1679:5
  17:     0x61b0a1b2d8fd - core::result::Result<T,E>::unwrap::hd7224680a3392f8a
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/result.rs:1102:23
...
  31:     0x61b0a1bbc983 - core::ops::function::FnOnce::call_once::hdfb680d6314cc1cf
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:250:5
  32:     0x61b0a1bbc983 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0170314226845550
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:155:18
  33:     0x61b0a1b945d9 - std::rt::lang_start::{{closure}}::h897cad62ecbdfa58
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:159:18
  34:     0x61b0a1f3c39d - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hf57beef1b8c334ce
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:284:13
  35:     0x61b0a1f3c39d - std::panicking::try::do_call::h65791b6ab5d9b39f
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559:40
  36:     0x61b0a1f3c39d - std::panicking::try::h5a3dd25e8a379a23
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523:19
  37:     0x61b0a1f3c39d - std::panic::catch_unwind::he2ce8403bab77de2
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149:14
  38:     0x61b0a1f3c39d - std::rt::lang_start_internal::{{closure}}::h0b55d0da19178545
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:141:48
  39:     0x61b0a1f3c39d - std::panicking::try::do_call::h33cbeb674c7644e0
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559:40
  40:     0x61b0a1f3c39d - std::panicking::try::h530c58b4c9daadba
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523:19
  41:     0x61b0a1f3c39d - std::panic::catch_unwind::h92e02677901e11e4
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149:14
  42:     0x61b0a1f3c39d - std::rt::lang_start_internal::hcee5ed89fc25829a
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:141:20
  43:     0x61b0a1c167bc - main
  44:     0x7f7782829d90 - <unknown>
  45:     0x7f7782829e40 - __libc_start_main
  46:     0x61b0a1b265c5 - _start
  47:                0x0 - <unknown>

Steps To Reproduce

Steps to reproduce the behavior:

cd packages/fullstack/example/auth
dx serve --platform fullstack

Expected behavior

No Error and I can see on the browser

Environment:

  • Dioxus version: v0.5
  • Rust version: 1.80.1
  • OS info: Ubuntu 22.04
  • App platform: fullstack

Questionnaire

  • [ x] I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@chungwong
Copy link
Contributor

Can you please double check your version? You mentioned you are using dioxu 0.5 but your error says otherwise.

thread 'main' panicked at packages/fullstack/examples/auth/src/main.rs:52:66:

That file structure is with the latest dioxus(0.6).

Also the below error COULD be from the mistached 0.5 client and 0.6 dioxus.

called `Result::unwrap()` on an `Err` value: UnableToLoadIndex("/home/dioxus/packages/fullstack/examples/auth/dist/public/index.html")

@matthunz
Copy link
Contributor

matthunz commented Sep 9, 2024

Are you running examples directly from the git repo?

If so you most likely need the latest dioxus-cli which you can install via cargo install [email protected] (if that doesn't work the latest git should definitely work cargo install dioxus-cli --git https://github.com/DioxusLabs/dioxus)

@matthunz matthunz added fullstack related to the fullstack crate needs reproduction An issue that is missing a reproduction labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fullstack related to the fullstack crate needs reproduction An issue that is missing a reproduction
Projects
None yet
Development

No branches or pull requests

3 participants