Closed dessalines closed 1 year ago
I'm not sure of how that function is implemented within Sycamore, but it looks like it expects web_sys
functions to be present. I would recommend using a #[cfg(client)]
gate above the .bind_value()
call. It won't be particularly ergonomic, but I'm afraid that's the best we can do in Perseus.
@lukechu10 should this function do nothing on the server-side, like bind:value
does in the macro?
For now my workaround is to do:
.c(view! {cx, input(bind:value = name)})
But yes I'm not sure why the builder version has requirements that the view! macro doesn't.
@lukechu10 should this function do nothing on the server-side, like
bind:value
does in the macro?
Ah yes that would be much better. I'll have to take a look at this.
Thanks! I'll create an issue referencing this over at sycamore.
Since this is now a Sycamore issue, I'll close this here for now.
This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels. The author described their issue as follows:
.c(input().bind_value(some_reactive_value))
, perseus fails compilation. It works correctly only when using the non-builder !view macrothread 'main' panicked at 'function not implemented on non-wasm32 targets', /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.84/src/lib.rs:1007:1
Log file: https://file.io/FIgR9nNZfETQ
The steps to reproduce this issue are as follows:
A minimum reproducible example is available at https://file.io/FIgR9nNZfETQ.
Tribble internal data
dHJpYmJsZS1yZXBvcnRlZCxDLWJ1ZyxBLWNsaQ==