conflicts with server_fn crate
Closed this issue · 1 comments
brianmay commented
Example source repo: https://github.com/brianmay/dioxus-fs-demo
Reproduce the error with:
cargo add server_fn
cargo build --profile server-dev --verbose --features server --bin dioxus-fs-demo
No other changes required.
This gives me:
E0659]: `server_fn` is ambiguous
--> src/main.rs:373:1
|
373 | #[server(EchoServer)]
| ^^^^^^^^^^^^^^^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `server_fn` could refer to a crate passed with `--extern`
= help: use `::server_fn` to refer to this crate unambiguously
note: `server_fn` could also refer to the crate imported here
--> src/main.rs:22:5
|
22 | use dioxus::prelude::*;
| ^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `server_fn` to disambiguate
= help: or use `crate::server_fn` to refer to this crate unambiguously
= note: this error originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `server_fn` is ambiguous
--> src/main.rs:379:1
|
379 | #[server(MagicNumber)]
| ^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `server_fn` could refer to a crate passed with `--extern`
= help: use `::server_fn` to refer to this crate unambiguously
note: `server_fn` could also refer to the crate imported here
--> src/main.rs:22:5
|
22 | use dioxus::prelude::*;
| ^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `server_fn` to disambiguate
= help: or use `crate::server_fn` to refer to this crate unambiguously
= note: this error originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `server_fn` is ambiguous
--> src/main.rs:385:1
|
385 | #[server(GetPenguinEncounters)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `server_fn` could refer to a crate passed with `--extern`
= help: use `::server_fn` to refer to this crate unambiguously
note: `server_fn` could also refer to the crate imported here
--> src/main.rs:22:5
|
22 | use dioxus::prelude::*;
| ^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `server_fn` to disambiguate
= help: or use `crate::server_fn` to refer to this crate unambiguously
= note: this error originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `server_fn` is ambiguous
--> src/main.rs:401:1
|
401 | #[server(CreatePenguinEncounter)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
= note: `server_fn` could refer to a crate passed with `--extern`
= help: use `::server_fn` to refer to this crate unambiguously
note: `server_fn` could also refer to the crate imported here
--> src/main.rs:22:5
|
22 | use dioxus::prelude::*;
| ^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit import of `server_fn` to disambiguate
= help: or use `crate::server_fn` to refer to this crate unambiguously
= note: this error originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0659`.
error: could not compile `dioxus-fs-demo` (bin "dioxus-fs-demo") due to 4 previous errors
Originally posted by @brianmay in #3378 (reply in thread)
brianmay commented
No need to include server_fn, because dioxus includes it with the prelude.