-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
#3278 causes hydration bugs #3283
Comments
I'm unsurprised that this change caused an issue, but can't take any meaningful action without a reproduction, unfortunately. |
In case it's helpful in narrowing things down to reproduce it, here's a description of what that change means. Previously, reading from a resource would only trigger Suspense if the resource's value was However, this meant that a resource that was re-loading would not trigger Suspense to fall back. The change means that reading from a resource always adds the resource to that Suspense's set of tasks, and spawns a task to wait for the resource to be ready, and then removes it from the set of tasks. This does not cause to seem a hydration issue in any of the examples in the repo. (I have manually tested some but not all of them, and the automated tests on those that have them didn't find anything.) Note also that 3de0414 should add a more helpful error message for the hydration error you pasted above, which may help narrow it down. |
@gbj might have a PR to solve this, still blind to the simple repro though. |
Hey @gbj, Just wanted to mention that I also found an hydration bug with nested I'll just give more details in case it can help understanding the issue or if someone with a similar case comes here. Here is the error I got:
In this case, app/src/icons.rs:214:5 is my loading icon used in the Transition fallback and the error appeared only when the content of the second In the process of trying (and failing '^^) to make a minimal reproduction, I also tried to move the component with the nested Please let me know if you want any other information :) |
I seem to be getting the same problem. Interestingly it only happens with Edit: Nevermind the crashes came back again. And it seems the erorr message points to completely random places. |
@gbj I have a repro, it's very strange but this is it 😅 : use leptos::prelude::*;
#[component]
pub fn Counters() -> impl IntoView {
view! {
<Transition>
<p>Hello</p>
</Transition>
<Inner />
}
}
#[component]
pub fn Inner() -> impl IntoView {
let resource =
Resource::new(|| (), |_| async move { vec!["foo".to_string()] });
resource.get_untracked();
view! { <div>World</div> }
}
So clearly this is probably user-misuse (although i'd like for this to work but understand if it shouldn't) that kind've makes sense is broken, but only actually caused any errors after #3278. So it seems the real issue is the |
Describe the bug
Sorry I haven't got a repro, but I've realised rc2, at least for me, has a new hydration bug caused by this commit:
8b258b0
Hopefully a look at the changes in that commit might instantly show you what's happened
The text was updated successfully, but these errors were encountered: