#Dioxus 0.7-rc with Dioxus-sdk 0.7-alpha.1

1 messages · Page 1 of 1 (latest)

placid bane
#

Are these two versions compatible?

Setup:

dioxus = { version = "0.7.0-rc.0", features = ["router"] }
dioxus-sdk = { version = "0.7.0-alpha.1", features = ["storage"] }

Issue:
Whenever I call use_persistent(), my app panics in the browser console with the following error:

patch_console.js:1 panicked at /Users/tn19n/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus_storage-0.1.0-alpha.1/src/persistence.rs:20:19:
called `Result::unwrap()` on an `Err` value: RuntimeError

Stack:

Error
    at http://127.0.0.1:8080/wasm/portfolio.js:1188:21
    at logError (http://127.0.0.1:8080/wasm/portfolio.js:43:18)
    at imports.wbg.__wbg_new_8a6f238a6ece86ea (http://127.0.0.1:8080/wasm/portfolio.js:1187:66)
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[35920]:0xbf4a89
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[20853]:0xb08982
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[5804]:0x8129ad
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[31759]:0xbc847b
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[26998]:0xb84155
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[11708]:0x9bb36d
    at http://127.0.0.1:8080/wasm/portfolio_bg.wasm:wasm-function[15353]:0xa60720


console.error @ patch_console.js:1
portfolio_bg.wasm:0xbf64be Uncaught RuntimeError: unreachable
    at portfolio_bg.wasm:0xbf64be
    at portfolio_bg.wasm:0xbf63b4
    at portfolio_bg.wasm:0xbf4751
    at portfolio_bg.wasm:0x9bb3a6
    at portfolio_bg.wasm:0xa60720
    at portfolio_bg.wasm:0xbf5e0c
    at portfolio_bg.wasm:0xbe67d1
    at portfolio_bg.wasm:0xbe67fe
    at portfolio_bg.wasm:0xab0467
    at portfolio_bg.wasm:0x8d1b41
placid bane
#

Changing back to stable versions works fine.

dioxus = { version = "0.6.3", features = ["router"] }
dioxus-sdk = { version = "0.6.0", features = ["storage"] }
sudden shoal
#
[patch.crates-io]
dioxus-geolocation = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus-notification = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus-sdk = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus_storage = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus-sync = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus-time = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus-util = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dioxus-window = { git = "https://github.com/ealmloff/dioxus-std", branch = "0.7" }
dull knot
#

just a follow up from this wrt use_persistent() and #[layout]...

As soon as I introduce #[layout] in my code I get a CapturePanic (snippet below).

If I then remove the use_persistent() all is ok...

Summary:
neither: ok
#[layout] only: components laid out as expected.
use_persistence only: no layout (clearly) but no panic either:
both: panic!

Encountered error: CapturedPanic
In scope: ScopeId(6, "frontend::route::Layout")
Backtrace:    0: <dioxus_core::error_boundary::CapturedError as core::convert::From<E>>::from
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/error_boundary.rs:417:32
   1: <dioxus_core::render_error::RenderError as core::convert::From<E>>::from
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/render_error.rs:44:23
   2: <T as core::convert::Into<U>>::into
             at /.../.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:778:9
   3: <dioxus_core::any_props::VProps<F,P,M> as dioxus_core::any_props::AnyProps>::render::render_inner
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/any_props.rs:88:63
   4: <dioxus_core::any_props::VProps<F,P,M> as dioxus_core::any_props::AnyProps>::render
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/any_props.rs:93:9
   5: dioxus_core::scope_arena::<impl dioxus_core::virtual_dom::VirtualDom>::run_scope::{{closure}}::{{closure}}::{{closure}}
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/scope_arena.rs:71:51
   6: dioxus_core::reactive_context::ReactiveContext::run_in
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/reactive_context.rs:211:19
   7: dioxus_core::reactive_context::ReactiveContext::reset_and_run_in
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/core/src/reactive_context.rs:202:14
sudden shoal
#

what is the panic that gets captured?

dull knot
#

I'm not totally sure - I can't follow the stack trace to extract what is relevant... hints on what to look for or how to interpret welcomed 😉

#

(I'm thinking this is related to how I launch the frontend and backend)... This is the end of the trace:

 137: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
             at /.../registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/context/blocking.rs:66:14
 138: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
             at /.../registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/scheduler/multi_thread/mod.rs:87:22
 139: tokio::runtime::context::runtime::enter_runtime
             at /.../registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/context/runtime.rs:65:16
 140: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /.../registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/scheduler/multi_thread/mod.rs:86:9
 141: tokio::runtime::runtime::Runtime::block_on_inner
             at /.../registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/runtime.rs:358:50
 142: tokio::runtime::runtime::Runtime::block_on
             at /.../registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/runtime.rs:330:18
 143: dioxus_desktop::launch::launch_virtual_dom
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/desktop/src/launch.rs:122:14
 144: dioxus_desktop::launch::launch
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/desktop/src/launch.rs:152:5
 145: dioxus::launch::LaunchBuilder::launch
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/dioxus/src/launch.rs:340:20
 146: dioxus::launch::launch
             at /.../git/checkouts/dioxus-d8abd2ecf6e8b5b4/10912f4/packages/dioxus/src/launch.rs:54:26
 147: frontend::launch_frontend
             at /.../Documents/cribbage/packages/frontend/src/lib.rs:8:5
 148: entrypoint::main
             at ./src/main.rs:10:5
sudden shoal
#

Usually that error is a panic in user code

#

I would search for any paths that match your project

dull knot
dull knot
sudden shoal
#

Try running cargo tree

#

You have multiple versions of dioxus with conflicting runtimes

#

You need to patch more than just the dioxus crate

#

I would patch dioxus-signals, dioxus-core and generational-box at least