-
-
Notifications
You must be signed in to change notification settings - Fork 842
Open
Description
I'm following the bug report template for discoverability, but please note that I also created a minimum reproducible example repository here: https://github.com/tannerntannern/leptos-firefox-bug-reprex
Describe the bug
<Suspense> within <details> element causes panic only in release mode, and only on Firefox (latest version). The <details> element might not be the root cause, but it's unclear to me what is.
Code snippets
Dependencies
# common
leptos = { version = "0.8.15", features = ["tracing"] }
# frontend only
console_error_panic_hook = { version = "0.1.7", optional = true }
wasm-bindgen = { version = "=0.2.106", optional = true }
# backend only
axum = { version = "0.8.8", optional = true }
leptos_axum = { version = "0.8.7", features = ["tracing"], optional = true }
tokio = { version = "1", features = ["full"], optional = true }App component
#[component]
pub fn App() -> impl IntoView {
let data_resource = OnceResource::new(get_data());
view! {
<details open>
<summary>"Server Data"</summary>
<Suspense fallback=move || view! { <div>"Loading data"</div> }>
{move || Suspend::new(async move {
let data = data_resource.await.unwrap();
view! {
"Data: "{data}
}
})}
</Suspense>
</details>
}
}
#[server]
async fn get_data() -> Result<String, ServerFnError> {
Ok("abc123".to_string())
}To Reproduce
- Install cargo-leptos version
0.3.2 - Run
cargo leptos watch --release(could not reproduce in debug mode) - Open the app in Firefox for MacOS (tested on latest version; could not reproduce in Chrome or Safari)
- Observe following error in the console (behavior is not consistent, might need to refresh a few times)
Error details
You should see something to the effect of
panicked at /Users/tnielsen/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tachys-0.2.11/src/hydration.rs:227:9:
internal error: entered unreachable code
...
Screenshots
Next Steps
- I will make a PR
- I would like to make a PR, but need help getting started
- I want someone else to take the time to fix this
- This is a low priority for me and is just shared for your information
Additional context
I can make any of the following changes in app.rs and the error goes away:
- Change the
<details>element to a<div> - Remove the outer
<details>element entirely - Change the
Suspensefallback tomove || "Loading data"(frommove || view! { <div>"Loading data"</div> })
Also mentioned above, but I cannot reproduce in any browser except Firefox. I can only reproduce in release mode.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels