Skip to content
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

Build failed (fullstack web app) #3298

Open
hinastory opened this issue Dec 6, 2024 · 15 comments
Open

Build failed (fullstack web app) #3298

hinastory opened this issue Dec 6, 2024 · 15 comments
Labels
bug Something isn't working cli Related to the dioxus-cli program

Comments

@hinastory
Copy link

Problem

The build of the fullstack web application fails with the following message.

09:12:30 [dev] Cargo build failed - no output location
09:12:30 [dev] Build failed: Other(Build did not return an executable)

Steps To Reproduce

Steps to reproduce the behavior:

  • dx new dx-fs
    • create fullstack app(web)
  • cd dx-fs
  • dx serve

Screenshots

image

Environment:

  • Dioxus version: 0.6.0-rc.0
  • Rust version: rustc 1.82.0
  • OS info: MacOS(M1)
  • App platform: Fullstack web
@kennethlove
Copy link

Having the same problem myself.

@DogeDark
Copy link
Member

DogeDark commented Dec 7, 2024

Would you be able to run with --trace and --verbose? It may output more useful information.

@DogeDark DogeDark added bug Something isn't working cli Related to the dioxus-cli program labels Dec 7, 2024
@hinastory
Copy link
Author

The output is as follows.

dx serve --verbose --trace
06:58:16 [dev] Loading crate                                                                                                                      
06:58:16 [dev] Found package NodeIndex(51)                                                                                                        
06:58:16 [dev] failed to read `dioxus/settings.toml` config file                                                                                  
06:58:16 [dev] Autodetecting platform from feature asset                                                                                          
06:58:16 [dev] Autodetecting platform from feature default                                                                                        
06:58:16 [dev] Autodetecting platform from feature devtools                                                                                       
06:58:16 [dev] Autodetecting platform from feature dioxus-cli-config                                                                              
06:58:16 [dev] Autodetecting platform from feature document                                                                                       
06:58:16 [dev] Autodetecting platform from feature file_engine                                                                                    
06:58:16 [dev] Autodetecting platform from feature fullstack                                                                                      
06:58:16 [dev] Autodetecting platform from feature hooks                                                                                          
06:58:16 [dev] Autodetecting platform from feature html                                                                                           
06:58:16 [dev] Autodetecting platform from feature launch                                                                                         
06:58:16 [dev] Autodetecting platform from feature macro                                                                                          
06:58:16 [dev] Autodetecting platform from feature mounted                                                                                        
06:58:16 [dev] Autodetecting platform from feature router                                                                                         
06:58:16 [dev] Autodetecting platform from feature signals                                                                                        
06:58:16 [dev] Autodetecting platform from feature web                                                                                            
06:58:16 [dev] Could not find explicit feature for platform server, passing `fallback` instead                                                    
06:58:16 [dev] Verifying tooling...                                                                                                               
06:58:16 [dev] wasm-bindgen version 0.2.97 is not compatible with the cli crate. Attempting to upgrade the target wasm-bindgen crate manually...  
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/Cargo.toml"                                                               
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/tailwind.config.js"                                                       
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/README.md"                                                                
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/input.css"                                                                
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/assets"                                                                   
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/Dioxus.toml"                                                              
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs/src"                                                                      
06:58:16 [dev] Watching path "/Users/hinastory/Documents/develop/rust/dx-fs"                                                                          
06:58:16 [dev] -----------------------------------------------------------------                                                                  
                Serving your Dioxus app: dx-fs 🚀                                                                                                 
                • Press `ctrl+c` to exit the server                                                                                               
                • Press `r` to rebuild the app                                                                                                    
                • Press `o` to open the app                                                                                                       
                • Press `v` to toggle verbose logging                                                                                             
                • Press `/` for more commands and shortcuts                                                                                       
                Learn more at https://dioxuslabs.com/learn/0.6/getting_started                                                                    
               ----------------------------------------------------------------                                                                   
06:58:17 [dev] ✅  wasm-bindgen updated successfully                                                                                              
06:58:17 [dev] Running build command...                                                                                                           
06:58:17 [dev] Building app...                                                                                                                    
06:58:17 [dev] Initialized Root dir: "/Users/hinastory/Documents/develop/rust/dx-fs/target/dx/dx-fs/debug/web/public"                                 
06:58:17 [dev] Initialized Exe dir: "/Users/hinastory/Documents/develop/rust/dx-fs/target/dx/dx-fs/debug/web/public/wasm"                             
06:58:17 [dev] Initialized Asset dir: "/Users/hinastory/Documents/develop/rust/dx-fs/target/dx/dx-fs/debug/web/public/assets"                         
06:58:17 [dev] Executing cargo...                                                                                                                 
06:58:17 [dev] cargo args: ["--profile", "dioxus-wasm", "--target", "wasm32-unknown-unknown", "--verbose", "--features", "web", "--bin", "dx-fs"] 
06:58:17 [dev] Building server...                                                                                                                 
06:58:17 [dev] Building app...                                                                                                                    
06:58:17 [dev] Executing cargo...                                                                                                                 
06:58:17 [dev] cargo args: ["--profile", "dioxus-server", "--verbose", "--features", "dioxus/server", "--bin", "dx-fs"]                           
06:58:17 [dev] cargo args: ["--profile", "dioxus-server", "--verbose", "--features", "dioxus/server", "--bin", "dx-fs"]                                                     
06:58:17 [dev] Rust cargo args: Command {                                                                                                         
    std: Command {                                                                                                                                
        program: "cargo",                                                                                                                         
        args: [                                                                                                                                   
            "cargo",                                                                                                                              
            "rustc",
            "--message-format",
            "json-diagnostic-rendered-ansi",
            "--profile",
            "dioxus-server",
            "--verbose",
            "--features",
            "dioxus/server",
            "--bin",
            "dx-fs",
        ],
        cwd: Some(
            "/Users/hinastory/Documents/develop/rust/dx-fs",
06:58:17 [dev] cargo args: ["--profile", "dioxus-wasm", "--target", "wasm32-unknown-unknown", "--verbose", "--features", "web", "--bin", "dx-fs"]
06:58:17 [dev] Rust cargo args: Command {
    std: Command {
        program: "cargo",
        args: [
            "cargo",
            "rustc",
            "--message-format",
            "json-diagnostic-rendered-ansi",
            "--profile",
            "dioxus-wasm",
            "--target",
            "wasm32-unknown-unknown",
            "--verbose",
            "--features",
            "web",
            "--bin",
            "dx-fs",
        ],
        cwd: Some(
            "/Users/hinastory/Documents/develop/rust/dx-fs",
        ),
    },
06:58:17 [cargo] error: failed to select a version for the requirement `dioxus-liveview = "^0.6.0-rc.0"`
06:58:17 [cargo] candidate versions found which didn't match: 0.6.0-alpha.5, 0.6.0-alpha.4, 0.6.0-alpha.3, ...
06:58:17 [cargo] location searched: crates.io index
06:58:17 [cargo] required by package `dioxus v0.6.0-rc.0`
06:58:17 [cargo]     ... which satisfies dependency `dioxus = "^0.6.0-rc.0"` (locked to 0.6.0-rc.0) of package `dx-fs v0.1.0 (/Users/hinastory/Documents/develop/rust/dx-fs)`
06:58:17 [cargo] if you are looking for the prerelease package it needs to be specified explicitly
06:58:17 [cargo]     dioxus-liveview = { version = "0.6.0-alpha.5" }
06:58:17 [dev] Cargo build failed - no output location
06:58:17 [dev] Setting builder to failed state
06:58:17 [dev] Build failed: Other(Build did not return an executable)
╭────────────────────────────────────────────────────────────────────────────────────────── /:more ╮
│  App:     ━━━━━━━━━━━━━━━━━━━━━━━━━━  ❌           Platform: Web + fullstack                     │
│  Server:  ━━━━━━━━━━━━━━━━━━━━━━━━━━  ❌           App features: ["web"]                         │
│  Status:  Failed                                   Serving at: http://127.0.0.1:8080             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

@DogeDark
Copy link
Member

DogeDark commented Dec 7, 2024

Looks like an issue with dioxus-liveview not finding a suitable version, yet the required version does exist on crates.io. Maybe try running cargo update -p dioxus-liveview. Alternatively you could try using 0.6.0 as it has been released.

@hinastory
Copy link
Author

I added the dependencies of the package that caused errors to Cargo.toml.

Cargo.toml

[package]
name = "dx-fs"
version = "0.1.0"
authors = ["hinastory <[email protected]>"]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dioxus = { version = "0.6.0-rc.0", features = ["router", "fullstack"] }
dioxus-logger = "0.5"
dioxus-liveview = "^0.6.0-rc.0"                                         # add
dioxus-ssr = "^0.6.0-rc.0"                                              # add
dioxus-isrg = "^0.6.0-rc.0"                                             # add

[features]
default = ["web"]
web = ["dioxus/web"]

However, the build failed with another error(mio crate) as follows.

❯❯❯ dx serve
08:18:56 [dev] wasm-bindgen version 0.2.97 is not compatible with the cli crate. Attempting to upgrade the target wasm-bindgen crate manually...                                                                                                                                
                                                                                                                                        
08:18:56 [dev] -----------------------------------------------------------------                                                        
                Serving your Dioxus app: dx-fs 🚀                                                                                       
                • Press `ctrl+c` to exit the server                                                                                     
                • Press `r` to rebuild the app                                                                                          
                • Press `o` to open the app                                                                                             
                • Press `v` to toggle verbose logging                                                                                   
                • Press `/` for more commands and shortcuts                                                                             
                Learn more at https://dioxuslabs.com/learn/0.6/getting_started                                                          
08:18:59 [dev] ✅  wasm-bindgen updated successfully
08:19:00 [cargo] error[E0432]: unresolved import `crate::sys::IoSourceState`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:14:5
   |
14 | use crate::sys::IoSourceState;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ no `IoSourceState` in `sys`

08:19:00 [cargo] error[E0432]: unresolved import `crate::sys::tcp`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:19:17
   |
19 | use crate::sys::tcp::{bind, listen, new_for_addr};
   |                 ^^^ could not find `tcp` in `sys`

08:19:00 [cargo] error[E0432]: unresolved import `crate::sys::tcp`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:17:17
   |
17 | use crate::sys::tcp::{connect, new_for_addr};
   |                 ^^^ could not find `tcp` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `Selector` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/poll.rs:322:18
    |
322 |             sys::Selector::new().map(|selector| Poll {
    |                  ^^^^^^^^ could not find `Selector` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:24:14
   |
24 |         sys::event::token(&self.inner)
   |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:38:14
   |
38 |         sys::event::is_readable(&self.inner)
   |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:43:14
   |
43 |         sys::event::is_writable(&self.inner)
   |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:68:14
   |
68 |         sys::event::is_error(&self.inner)
   |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:99:14
   |
99 |         sys::event::is_read_closed(&self.inner)
   |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:129:14
    |
129 |         sys::event::is_write_closed(&self.inner)
    |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:151:14
    |
151 |         sys::event::is_priority(&self.inner)
    |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:173:14
    |
173 |         sys::event::is_aio(&self.inner)
    |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:183:14
    |
183 |         sys::event::is_lio(&self.inner)
    |              ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `event` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:221:26
    |
221 |                     sys::event::debug_details(f, self.0)
    |                          ^^^^^ could not find `event` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `tcp` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:107:18
    |
107 |             sys::tcp::accept(inner).map(|(stream, addr)| (TcpStream::from_std(stream), addr))
    |                  ^^^ could not find `tcp` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `udp` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/udp.rs:126:14
    |
126 |         sys::udp::bind(addr).map(UdpSocket::from_std)
    |              ^^^ could not find `udp` in `sys`

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `udp` in `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/udp.rs:548:14
    |
548 |         sys::udp::only_v6(&self.inner)
    |              ^^^ could not find `udp` in `sys`

08:19:00 [cargo] error[E0412]: cannot find type `Selector` in module `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/poll.rs:273:20
    |
273 |     selector: sys::Selector,
    |                    ^^^^^^^^ not found in `sys`

08:19:00 [cargo] error[E0412]: cannot find type `Selector` in module `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/poll.rs:730:44
    |
730 |     pub(crate) fn selector(&self) -> &sys::Selector {
    |                                            ^^^^^^^^ not found in `sys`

08:19:00 [cargo] error[E0412]: cannot find type `Waker` in module `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/waker.rs:79:17
   |
79 |     inner: sys::Waker,
   |                 ^^^^^ not found in `sys`
   |
help: consider importing one of these structs
   |
1  + use crate::Waker;
   |
1  + use std::task::Waker;
   |
help: if you import `Waker`, refer to it directly
   |
79 -     inner: sys::Waker,
79 +     inner: Waker,
   |

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `Waker` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/waker.rs:87:14
   |
87 |         sys::Waker::new(registry.selector(), token).map(|inner| Waker { inner })
   |              ^^^^^ could not find `Waker` in `sys`
   |
help: consider importing one of these structs
   |
1  + use crate::Waker;
   |
1  + use std::task::Waker;
   |
help: if you import `Waker`, refer to it directly
   |
87 -         sys::Waker::new(registry.selector(), token).map(|inner| Waker { inner })
87 +         Waker::new(registry.selector(), token).map(|inner| Waker { inner })
   |

08:19:00 [cargo] error[E0412]: cannot find type `Event` in module `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:18:17
   |
18 |     inner: sys::Event,
   |                 ^^^^^ not found in `sys`
   |
help: consider importing this struct through its public re-export
   |
1  + use crate::event::Event;
   |
help: if you import `Event`, refer to it directly
   |
18 -     inner: sys::Event,
18 +     inner: Event,
   |

08:19:00 [cargo] error[E0412]: cannot find type `Event` in module `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:187:55
    |
187 |     pub(crate) fn from_sys_event_ref(sys_event: &sys::Event) -> &Event {
    |                                                       ^^^^^ not found in `sys`
    |
help: consider importing this struct through its public re-export
    |
1   + use crate::event::Event;
    |
help: if you import `Event`, refer to it directly
    |
187 -     pub(crate) fn from_sys_event_ref(sys_event: &sys::Event) -> &Event {
187 +     pub(crate) fn from_sys_event_ref(sys_event: &Event) -> &Event {
    |

08:19:00 [cargo] error[E0412]: cannot find type `Event` in module `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:191:41
    |
191 |             &*(sys_event as *const sys::Event as *const Event)
    |                                         ^^^^^ not found in `sys`
    |
help: consider importing this struct through its public re-export
    |
1   + use crate::event::Event;
    |
help: if you import `Event`, refer to it directly
    |
191 -             &*(sys_event as *const sys::Event as *const Event)
191 +             &*(sys_event as *const Event as *const Event)
    |

08:19:00 [cargo] error[E0412]: cannot find type `Event` in module `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/event.rs:217:46
    |
217 |             struct EventDetails<'a>(&'a sys::Event);
    |                                              ^^^^^ not found in `sys`
    |
help: consider importing this struct through its public re-export
    |
1   + use crate::event::Event;
    |
help: if you import `Event`, refer to it directly
    |
217 -             struct EventDetails<'a>(&'a sys::Event);
217 +             struct EventDetails<'a>(&'a Event);
    |

08:19:00 [cargo] error[E0412]: cannot find type `Events` in module `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/events.rs:43:17
   |
43 |     inner: sys::Events,
   |                 ^^^^^^ not found in `sys`
   |
help: consider importing this struct through its public re-export
   |
1  + use crate::Events;
   |
help: if you import `Events`, refer to it directly
   |
43 -     inner: sys::Events,
43 +     inner: Events,
   |

08:19:00 [cargo] error[E0433]: failed to resolve: could not find `Events` in `sys`
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/events.rs:94:25
   |
94 |             inner: sys::Events::with_capacity(capacity),
   |                         ^^^^^^ could not find `Events` in `sys`
   |
help: consider importing this struct through its public re-export
   |
1  + use crate::Events;
   |
help: if you import `Events`, refer to it directly
   |
94 -             inner: sys::Events::with_capacity(capacity),
94 +             inner: Events::with_capacity(capacity),
   |

08:19:00 [cargo] error[E0412]: cannot find type `Events` in module `sys`
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/events.rs:189:47
    |
189 |     pub(crate) fn sys(&mut self) -> &mut sys::Events {
    |                                               ^^^^^^ not found in `sys`
    |
help: consider importing this struct through its public re-export
    |
1   + use crate::Events;
    |
help: if you import `Events`, refer to it directly
    |
189 -     pub(crate) fn sys(&mut self) -> &mut sys::Events {
189 +     pub(crate) fn sys(&mut self) -> &mut Events {
    |

08:19:00 [cargo] error[E0425]: cannot find value `listener` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:78:24
   |
78 |         set_reuseaddr(&listener.inner, true)?;
   |                        ^^^^^^^^ not found in this scope

08:19:00 [cargo] error[E0425]: cannot find value `listener` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:80:15
   |
80 |         bind(&listener.inner, addr)?;
   |               ^^^^^^^^ not found in this scope

08:19:00 [cargo] error[E0425]: cannot find value `listener` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:81:17
   |
81 |         listen(&listener.inner, 1024)?;
   |                 ^^^^^^^^ not found in this scope

08:19:00 [cargo] error[E0425]: cannot find value `listener` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:82:12
   |
82 |         Ok(listener)
   |            ^^^^^^^^ not found in this scope

08:19:00 [cargo] error[E0425]: cannot find value `stream` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:97:18
   |
97 |         connect(&stream.inner, addr)?;
   |                  ^^^^^^ not found in this scope

08:19:00 [cargo] error[E0425]: cannot find value `stream` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:98:12
   |
98 |         Ok(stream)
   |            ^^^^^^ not found in this scope

08:19:00 [cargo] error[E0425]: cannot find function `set_reuseaddr` in this scope
  --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:78:9
   |
78 |         set_reuseaddr(&listener.inner, true)?;
   |         ^^^^^^^^^^^^^ not found in this scope

08:19:00 [cargo] error[E0599]: no method named `register` found for struct `IoSource<std::net::TcpListener>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:150:20
    |
150 |         self.inner.register(registry, token, interests)
    |                    ^^^^^^^^ method not found in `IoSource<TcpListener>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `register` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `register`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0599]: no method named `reregister` found for struct `IoSource<std::net::TcpListener>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:159:20
    |
159 |         self.inner.reregister(registry, token, interests)
    |                    ^^^^^^^^^^ method not found in `IoSource<TcpListener>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `reregister` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `reregister`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0599]: no method named `deregister` found for struct `IoSource<std::net::TcpListener>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:163:20
    |
163 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<TcpListener>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `deregister` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `deregister`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0308]: mismatched types
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/listener.rs:286:9
    |
286 | /         unsafe {
287 | |             #[cfg(any(unix, target_os = "hermit", target_os = "wasi"))]
288 | |             {
289 | |                 net::TcpListener::from_raw_fd(listener.into_raw_fd())
...   |
294 | |             }
295 | |         }
    | |_________^ expected `TcpListener`, found `()`

08:19:00 [cargo] error[E0599]: no method named `register` found for struct `IoSource<std::net::TcpStream>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:332:20
    |
332 |         self.inner.register(registry, token, interests)
    |                    ^^^^^^^^ method not found in `IoSource<TcpStream>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `register` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `register`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0599]: no method named `reregister` found for struct `IoSource<std::net::TcpStream>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:341:20
    |
341 |         self.inner.reregister(registry, token, interests)
    |                    ^^^^^^^^^^ method not found in `IoSource<TcpStream>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `reregister` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `reregister`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0599]: no method named `deregister` found for struct `IoSource<std::net::TcpStream>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:345:20
    |
345 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<TcpStream>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `deregister` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `deregister`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0308]: mismatched types
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/tcp/stream.rs:468:9
    |
468 | /         unsafe {
469 | |             #[cfg(any(unix, target_os = "hermit", target_os = "wasi"))]
470 | |             {
471 | |                 net::TcpStream::from_raw_fd(stream.into_raw_fd())
...   |
476 | |             }
477 | |         }
    | |_________^ expected `TcpStream`, found `()`

08:19:00 [cargo] error[E0599]: no method named `register` found for struct `IoSource<std::net::UdpSocket>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/udp.rs:626:20
    |
626 |         self.inner.register(registry, token, interests)
    |                    ^^^^^^^^ method not found in `IoSource<UdpSocket>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `register` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `register`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0599]: no method named `reregister` found for struct `IoSource<std::net::UdpSocket>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/udp.rs:635:20
    |
635 |         self.inner.reregister(registry, token, interests)
    |                    ^^^^^^^^^^ method not found in `IoSource<UdpSocket>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `reregister` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `reregister`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0599]: no method named `deregister` found for struct `IoSource<std::net::UdpSocket>` in the current scope
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/udp.rs:639:20
    |
639 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<UdpSocket>`
    |
   ::: /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/io_source.rs:37:1
    |
37  | pub struct IoSource<T> {
    | ---------------------- method `deregister` not found for this struct
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `deregister`, perhaps you need to implement it
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/event/source.rs:75:1
    |
75  | pub trait Source {
    | ^^^^^^^^^^^^^^^^

08:19:00 [cargo] error[E0308]: mismatched types
   --> /Users/hinastory/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-1.0.3/src/net/udp.rs:762:9
    |
762 | /         unsafe {
763 | |             #[cfg(any(unix, target_os = "hermit", target_os = "wasi"))]
764 | |             {
765 | |                 net::UdpSocket::from_raw_fd(socket.into_raw_fd())
...   |
770 | |             }
771 | |         }
    | |_________^ expected `UdpSocket`, found `()`

08:19:00 [cargo] error: aborting due to 47 previous errors

08:19:00 [cargo] Some errors have detailed explanations: E0308, E0412, E0425, E0432, E0433, E0599.
08:19:00 [cargo] For more information about an error, try `rustc --explain E0308`.
08:19:03 [dev] Build failed: Other(Cargo build failed, signaled by the compiler)
╭────────────────────────────────────────────────────────────────────────────────────────── /:more ╮
│  App:     ━━━━━━━━━━━━━━━━━━━━━━━━━━  ❌           Platform: Web + fullstack                     │
│  Server:  ━━━━━━━━━━━━━━━━━━━━━━━━━━  ❌           App features: ["web"]                         │
│  Status:  Failed                                   Serving at: http://127.0.0.1:8080             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

@xiehaiyong
Copy link

I've also encountered a similar problem.

08:15:21 [dev] -----------------------------------------------------------------
Serving your Dioxus app: fuweb6 🚀
• Press ctrl+c to exit the server
• Press r to rebuild the app
• Press o to open the app
• Press v to toggle verbose logging
• Press / for more commands and shortcuts
Learn more at https://dioxuslabs.com/learn/0.6/getting_started
----------------------------------------------------------------
08:15:21 [dev] wasm-bindgen version 0.2.99 is not compatible with the cli crate (0.2.97). Attempting to upgrade the target wasm-bindgen crate manually...
08:15:23 [dev] Failed to update wasm-bindgen: Output { status: ExitStatus(ExitStatus(101)), stdout: "", stderr: " Updating crates.io index\nerror: failed to select a version for the requirement wasm-bindgen = \"=0.2.99\"\ncandidate versions found which didn't match: 0.2.97\nlocation searched: crates.io index\nrequired by package web-sys v0.3.76\n ... which satisfies dependency web-sys = \"^0.3.76\" (locked to 0.3.76) of package fuweb6 v0.1.0 (F:\\gadget\\fuweb6)\n" }
08:15:24 [dev] Build failed: Other(Failed to write main executable

Caused by:
0: Failed to generate wasm-bindgen bindings
1:

   it looks like the Rust project used to create this Wasm file was linked against
   version of wasm-bindgen that uses a different bindgen format than this binary:

     rust Wasm file schema version: 0.2.99
        this binary schema version: 0.2.97

   Currently the bindgen format is unstable enough that these two schema versions
   must exactly match. You can accomplish this by either updating this binary or
   the wasm-bindgen dependency in the Rust project.

   You should be able to update the wasm-bindgen dependency with:

       cargo update -p wasm-bindgen --precise 0.2.97

   don't forget to recompile your Wasm file! Alternatively, you can update the
   binary with:

       cargo install -f wasm-bindgen-cli --version 0.2.99

   if this warning fails to go away though and you're not sure what to do feel free
   to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
   )

╭────────────────────────────────────────────────────────────────────────────────────────── /:more ╮
│ App: ━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ Platform: Web + fullstack │
│ Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ App features: ["web"] │
│ Status: Failed Serving at: http://127.0.0.1:8080
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

@xiehaiyong
Copy link

I've also encountered a similar problem.

08:15:21 [dev] ----------------------------------------------------------------- Serving your Dioxus app: fuweb6 🚀 • Press ctrl+c to exit the server • Press r to rebuild the app • Press o to open the app • Press v to toggle verbose logging • Press / for more commands and shortcuts Learn more at https://dioxuslabs.com/learn/0.6/getting_started ---------------------------------------------------------------- 08:15:21 [dev] wasm-bindgen version 0.2.99 is not compatible with the cli crate (0.2.97). Attempting to upgrade the target wasm-bindgen crate manually... 08:15:23 [dev] Failed to update wasm-bindgen: Output { status: ExitStatus(ExitStatus(101)), stdout: "", stderr: " Updating crates.io index\nerror: failed to select a version for the requirement wasm-bindgen = \"=0.2.99\"\ncandidate versions found which didn't match: 0.2.97\nlocation searched: crates.io index\nrequired by package web-sys v0.3.76\n ... which satisfies dependency web-sys = \"^0.3.76\" (locked to 0.3.76) of package fuweb6 v0.1.0 (F:\\gadget\\fuweb6)\n" } 08:15:24 [dev] Build failed: Other(Failed to write main executable

Caused by: 0: Failed to generate wasm-bindgen bindings 1:

   it looks like the Rust project used to create this Wasm file was linked against
   version of wasm-bindgen that uses a different bindgen format than this binary:

     rust Wasm file schema version: 0.2.99
        this binary schema version: 0.2.97

   Currently the bindgen format is unstable enough that these two schema versions
   must exactly match. You can accomplish this by either updating this binary or
   the wasm-bindgen dependency in the Rust project.

   You should be able to update the wasm-bindgen dependency with:

       cargo update -p wasm-bindgen --precise 0.2.97

   don't forget to recompile your Wasm file! Alternatively, you can update the
   binary with:

       cargo install -f wasm-bindgen-cli --version 0.2.99

   if this warning fails to go away though and you're not sure what to do feel free
   to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
   )

╭────────────────────────────────────────────────────────────────────────────────────────── /:more ╮ │ App: ━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ Platform: Web + fullstack │ │ Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ App features: ["web"] │ │ Status: Failed Serving at: http://127.0.0.1:8080 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

PS F:\gadget\fuweb6> cargo update -p wasm-bindgen --precise 0.2.97
Updating crates.io index
error: failed to select a version for the requirement wasm-bindgen = "=0.2.99"
candidate versions found which didn't match: 0.2.97
location searched: crates.io index
required by package web-sys v0.3.76
... which satisfies dependency web-sys = "^0.3.76" (locked to 0.3.76) of package fuweb6 v0.1.0 (F:\gadget\fuweb6)

@ealmloff
Copy link
Member

ealmloff commented Dec 9, 2024

I added the dependencies of the package that caused errors to Cargo.toml.

Cargo.toml

[package]
name = "dx-fs"
version = "0.1.0"
authors = ["hinastory <[email protected]>"]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dioxus = { version = "0.6.0-rc.0", features = ["router", "fullstack"] }
dioxus-logger = "0.5"
dioxus-liveview = "^0.6.0-rc.0"                                         # add
dioxus-ssr = "^0.6.0-rc.0"                                              # add
dioxus-isrg = "^0.6.0-rc.0"                                             # add

[features]
default = ["web"]
web = ["dioxus/web"]

Server dependencies like dioxus-liveview and dioxus-isrg are generally not compatible with wasm. If you are trying to set up a fullstack application, you can use two features: one for the server and one for the client. Each of those features should enable dependencies that are required only for that build. Documentation for fullstack dependency handling will be added in DioxusLabs/docsite#331

For example, if you need dioxus-liveview, dioxus-ssr, and dioxus-isrg on the server, your dependencies section could look like this:

[dependencies]
dioxus = { version = "0.6.0-rc.0", features = ["router", "fullstack"] }
dioxus-logger = "0.5"
dioxus-liveview = { version = "^0.6.0-rc.0", optional = true }
dioxus-ssr = { version = "^0.6.0-rc.0", optional = true }
dioxus-isrg = { version = "^0.6.0-rc.0", optional = true }

[features]
default = []
web = ["dioxus/web"] # this feature will be used to build the client side of fullstack
server = ["dioxus/server", "dep:dioxus-liveview", "dep:dioxus-ssr", "dep:dioxus-isrg"] # this feature will be used to build the server side of fullstack

dioxus-ssr and diouxs-isrg are included in dioxus/server so you might not need to pull them in manually if you just need to set up incremental SSR on the server.

dioxus-liveview is a completely different rendering approach from dioxus fullstack and can't easily be combined with fullstack on the same page. If you want to use fullstack for some pages, and liveview for others, you can set that up

@ealmloff
Copy link
Member

ealmloff commented Dec 9, 2024

I've also encountered a similar problem.

08:15:21 [dev] ----------------------------------------------------------------- Serving your Dioxus app: fuweb6 🚀 • Press ctrl+c to exit the server • Press r to rebuild the app • Press o to open the app • Press v to toggle verbose logging • Press / for more commands and shortcuts Learn more at https://dioxuslabs.com/learn/0.6/getting_started ---------------------------------------------------------------- 08:15:21 [dev] wasm-bindgen version 0.2.99 is not compatible with the cli crate (0.2.97). Attempting to upgrade the target wasm-bindgen crate manually... 08:15:23 [dev] Failed to update wasm-bindgen: Output { status: ExitStatus(ExitStatus(101)), stdout: "", stderr: " Updating crates.io index\nerror: failed to select a version for the requirement wasm-bindgen = \"=0.2.99\"\ncandidate versions found which didn't match: 0.2.97\nlocation searched: crates.io index\nrequired by package web-sys v0.3.76\n ... which satisfies dependency web-sys = \"^0.3.76\" (locked to 0.3.76) of package fuweb6 v0.1.0 (F:\\gadget\\fuweb6)\n" } 08:15:24 [dev] Build failed: Other(Failed to write main executable

Try reinstalling the CLI with --force (and without the --locked flag). The version of wasm bindgen the CLI uses is not locked so it will use the latest version that is available when you install.

@prehonor
Copy link

prehonor commented Dec 9, 2024

@xiehaiyong
Copy link

I've also encountered a similar problem.
08:15:21 [dev] ----------------------------------------------------------------- Serving your Dioxus app: fuweb6 🚀 • Press ctrl+c to exit the server • Press r to rebuild the app • Press o to open the app • Press v to toggle verbose logging • Press / for more commands and shortcuts Learn more at https://dioxuslabs.com/learn/0.6/getting_started ---------------------------------------------------------------- 08:15:21 [dev] wasm-bindgen version 0.2.99 is not compatible with the cli crate (0.2.97). Attempting to upgrade the target wasm-bindgen crate manually... 08:15:23 [dev] Failed to update wasm-bindgen: Output { status: ExitStatus(ExitStatus(101)), stdout: "", stderr: " Updating crates.io index\nerror: failed to select a version for the requirement wasm-bindgen = \"=0.2.99\"\ncandidate versions found which didn't match: 0.2.97\nlocation searched: crates.io index\nrequired by package web-sys v0.3.76\n ... which satisfies dependency web-sys = \"^0.3.76\" (locked to 0.3.76) of package fuweb6 v0.1.0 (F:\\gadget\\fuweb6)\n" } 08:15:24 [dev] Build failed: Other(Failed to write main executable

Try reinstalling the CLI with --force (and without the --locked flag). The version of wasm bindgen the CLI uses is not locked so it will use the latest version that is available when you install.

I use 'cargo binstall [email protected] --Force "reinstalled CLI, but the problem remains the same

@ealmloff
Copy link
Member

ealmloff commented Dec 9, 2024

I use 'cargo binstall [email protected] --Force "reinstalled CLI, but the problem remains the same

Binstall will not recompile the CLI. use cargo install [email protected] --force

@emilbonnek
Copy link

emilbonnek commented Dec 9, 2024

I am getting this error using 0.6.0 after scaffolding a brand new fullstack app (bare-bones).
I have updated CLI with cargo install [email protected] --force.

Do I really need to add the optional dependencies and features? I literally just scaffolded so I think it would be nice if the templates just produced a working app out of the box.

Update: My issue seems to be caused by running my app inside a workspace with another bin that used axum 0.7.9.

@xiehaiyong
Copy link

I am getting this error using 0.6.0 after scaffolding a brand new fullstack app (bare-bones). I have updated CLI with cargo install [email protected] --force.

Do I really need to add the optional dependencies and features? I literally just scaffolded so I think it would be nice if the templates just produced a working app out of the box.

The system I am using is Win11,after installing "NASM" and "cmake", I can successfully install Dioxus 0.6.0
#2982
Netwide Assembler (NASM) must be installed for win11
https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/
Inside its shell install cli
https://github.com/DioxusGrow/dioxus_translator?tab=readme-ov-file#quick-start

@DogeDark
Copy link
Member

For the original version mismatch issue with dioxus-liveview, someone had success clearing their cargo registry cache located in the cargo home folder. I am curious if running cargo fetch would solve this too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the dioxus-cli program
Projects
None yet
Development

No branches or pull requests

7 participants