Skip to content

[Suggestion] Adding server features in Cargo.toml when initializing dx project #4598

@arne-fuchs

Description

@arne-fuchs

Dioxus seem to compile the project with missing web assembly targets.
Steps to reproduce the behavior:

  • Install dioxus for windows as described online (webassembly target has been added)
  • init project with dx with fullstack and router enabled and defaults to web
  • try to run it with dx serve --fullstack
 dx serve --fullstack                     
09:07:35 [dev] -----------------------------------------------------------------
                Serving your Dioxus app: dashboard
                • Press `ctrl+c` to exit the server
                • Press `r` to rebuild the app
                • Press `p` to toggle automatic rebuilds
                • Press `v` to toggle verbose logging
                • Press `/` for more commands and shortcuts
                Learn more at https://dioxuslabs.com/learn/0.6/getting_started
               ---------------------------------------------------------------- 
09:07:42 [server] thread 'main' panicked at C:\Users\ArneFuchs\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\dioxus-cli-config-0.6.3\src\lib.rs:233:1:
09:07:42 [dev] Build completed successfully in 3449ms, launching app! 💫
09:07:42 [server] cannot call wasm-bindgen imported functions on non-wasm targets
09:07:42 [server] stack backtrace:
09:07:42 [server] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
09:07:42 [dev] Application [web] exited with error: exit code: 101
╭────────────────────────────────────────────────────────────────────────────────────────── /:more ╮
│  App:     ━━━━━━━━━━━━━━━━━━━━━━━━━━  🎉 3.6s      Platform: Web + fullstack                     │
│  Server:  ━━━━━━━━━━━━━━━━━━━━━━━━━━  🎉 3.6s      App features: ["web"]                         │
│  Status:  Serving dashboard 🚀 7.0s          Serving at: http://127.0.0.1:8080             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

Environment:

  • Dioxus version: 0.6.3
  • Rust version: rustc 1.89.0, stable
  • OS info: Windows 11
  • App platform: web

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions