Skip to content

use_color_mode panicking with "already mutably borrowed: BorrowError" in reactive_graph #238

@nlfiedler

Description

@nlfiedler

Simply calling use_color_mode() is enough to cause the error, which appears in the terminal window.

Start by creating a new actix-based leptos project: cargo leptos new --git https://github.com/leptos-rs/start-actix

Update Cargo.toml to upgrade the leptos crates from 0.7.0 to 0.7.8 (the latest as of today), then add leptos-use = "0.15.7" and these two lines in the [features] section:

  "leptos-use/ssr",
  "leptos-use/actix",

Then add use leptos_use::{use_color_mode, UseColorModeReturn}; at the top of src/app.rs and let UseColorModeReturn { mode, set_mode, .. } = use_color_mode(); after the on_click line in the HomePage component. Then start the app with cargo leptos watch and attempt to open the page. You should see this in the terminal:

thread 'actix-rt|system:0|arbiter:0' panicked at /Users/nfiedler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reactive_graph-0.1.8/src/owner.rs:296:26:
already mutably borrowed: BorrowError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions