Skip to content

wasm32-unknown-unknown target fails to compile on v0.8.0 #21

@ewilken

Description

@ewilken

Hi there! Thanks a ton for this great crate!

We recently tried to update our usage of it to version 0.8.0 to get the new connection retries and saw the parts that are gated behind #[cfg(target_arch = "wasm32")] fail to compile with what looks like breaking changes on the Leptos 0.7 imports:

cargo check --target wasm32-unknown-unknown 
    Checking leptos_server_signal v0.8.0
error[E0432]: unresolved imports `leptos::use_context`, `leptos::create_effect`, `leptos::create_rw_signal`, `leptos::SignalGet`, `leptos::SignalSet`
   --> src/lib.rs:158:26
    |
158 |             use leptos::{use_context, create_effect, create_rw_signal, SignalGet, SignalSet};
    |                          ^^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^  ^^^^^^^^^  ^^^^^^^^^ no `SignalSet` in the root
    |                          |            |              |                 |
    |                          |            |              |                 no `SignalGet` in the root
    |                          |            |              no `create_rw_signal` in the root
    |                          |            no `create_effect` in the root
    |                          no `use_context` in the root

error[E0432]: unresolved imports `leptos::provide_context`, `leptos::RwSignal`
   --> src/lib.rs:195:22
    |
195 |         use leptos::{provide_context, RwSignal};
    |                      ^^^^^^^^^^^^^^^  ^^^^^^^^ no `RwSignal` in the root
    |                      |
    |                      no `provide_context` in the root
    |
    = help: consider importing this struct instead:
            leptos::prelude::RwSignal

error[E0432]: unresolved imports `leptos::use_context`, `leptos::SignalUpdate`
   --> src/lib.rs:223:26
    |
223 |             use leptos::{use_context, SignalUpdate};
    |                          ^^^^^^^^^^^  ^^^^^^^^^^^^ no `SignalUpdate` in the root
    |                          |
    |                          no `use_context` in the root

error[E0432]: unresolved import `leptos::use_context`
   --> src/lib.rs:272:17
    |
272 |             use leptos::use_context;
    |                 ^^^^^^^^^^^^^^^^^^^ no `use_context` in the root

error[E0599]: no method named `set` found for struct `WriteSignal` in the current scope
   --> src/lib.rs:172:25
    |
172 |                     set.set(new_value);
    |                         ^^^ method not found in `WriteSignal<T>`
    |
   ::: /Users/elias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reactive_graph-0.1.7/src/traits.rs:525:8
    |
525 |     fn set(&self, value: Self::Value);
    |        --- the method is available for `WriteSignal<T>` here
    |
    = help: items from traits can only be used if the trait is in scope
help: trait `Set` which provides `set` is implemented but not in scope; perhaps you want to import it
    |
3   + use leptos::prelude::Set;
    |

error[E0277]: the size for values of type `[PatchOperation]` cannot be known at compilation time
   --> src/lib.rs:245:37
    |
245 | ...                   for patch in delayed_patches {
    |                           ^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[PatchOperation]`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[PatchOperation]` cannot be known at compilation time
   --> src/lib.rs:245:46
    |
245 | ...                   for patch in delayed_patches {
    |                                    ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[PatchOperation]`
note: required by an implicit `Sized` bound in `std::option::Option`
   --> /Users/elias/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:572:17
    |
572 | pub enum Option<T> {
    |                 ^ required by the implicit `Sized` requirement on this type parameter in `Option`

error[E0277]: the size for values of type `[PatchOperation]` cannot be known at compilation time
   --> src/lib.rs:245:33
    |
245 | / ...                   for patch in delayed_patches {
246 | | ...                       json_patch::patch(doc, &patch).unwrap();
247 | | ...                   }
    | |_______________________^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[PatchOperation]`
note: required by a bound in `std::prelude::v1::None`
   --> /Users/elias/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:572:17
    |
572 | pub enum Option<T> {
    |                 ^ required by this bound in `Option::None`
...
576 |     None,
    |     ---- required by a bound in this variant

Some errors have detailed explanations: E0277, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `leptos_server_signal` (lib) due to 8 previous errors

Are we missing something, or is this a bug? Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions