tqwewe / leptos_server_signal

Leptos server signals synced through websockets
MIT License
56 stars 12 forks source link

Error when using with leptos 0.4.0 #4

Closed savoiringfaire closed 1 year ago

savoiringfaire commented 1 year ago

Currently getting this error message when trying to use with leptos 0.4.0:

error[E0308]: mismatched types
  --> src/lib.rs:41:45
   |
41 |     leptos_server_signal::provide_websocket(cx, "ws://localhost:3000/ws").unwrap();
   |     --------------------------------------- ^^ expected `leptos_reactive::scope::Scope`, found `leptos::Scope`
   |     |
   |     arguments to this function are incorrect
   |
   = note: `leptos::Scope` and `leptos_reactive::scope::Scope` have similar names, but are actually distinct types
note: `leptos::Scope` is defined in crate `leptos_reactive`
  --> /home/marcus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/leptos_reactive-0.4.2/src/scope.rs:98:1
   |
98 | pub struct Scope {
   | ^^^^^^^^^^^^^^^^
note: `leptos_reactive::scope::Scope` is defined in crate `leptos_reactive`
  --> /home/marcus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/leptos_reactive-0.3.1/src/scope.rs:99:1
   |
99 | pub struct Scope {
   | ^^^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `leptos_reactive` are being used?
note: function defined here
  --> /home/marcus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/leptos_server_signal-0.4.0/src/lib.rs:85:8
   |
85 | pub fn provide_websocket(cx: Scope, url: &str) -> Result<(), JsValue> {