DioxusLabs / example-projects

Featured Dioxus projects on how to build clean user interfaces in Rust
498 stars 63 forks source link

e-commerce example won't compile #30

Closed ra0x3 closed 10 months ago

ra0x3 commented 1 year ago

Problem

I'm trying to compile the e-commerce example (as it seems to be one of the more fully-featured examples) but my compilation just hangs after dioxus serve

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

Screenshots

[WARN] You appear to be creating a Dioxus project from scratch; we will use the default config [INFO] 🚅 Running build command... / Compiling futures-sink 0.3.28 (registry+https://github.com/rust-lang/crates.io-index) Compiling serde v1.0.164 Compiling futures-util v0.3.28 Compiling thiserror v1.0.40 Compiling mio v0.8.8 Compiling num-traits v0.2.15 Compiling crossbeam-utils v0.8.16 Compiling wasm-bindgen-macro-support v0.2.87 | Compiling ahash 0.7.6 (registry+https://github.com/rust-lang/crates.io-index) Compiling http v0.2.9 \ Compiling ahash 0.7.6 (registry+https://github.com/rust-lang/crates.io-index) / Compiling ahash 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)



**Environment:**
 - Dioxus version: `master`
 - Rust version: `rustc 1.69.0 (84c898d65 2023-04-16)`
 - OS info: `Darwin Rashads-MacBook-Air.local 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:52 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8112 arm64`
 - App platform: `web`

**Questionnaire**
<!-- If you feel up to the challenge, please check one of the boxes below: -->
- [x] I'm interested in fixing this myself but don't know where to start
- [ ] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later
GTP95 commented 11 months ago

Could you check if pr #42 fixes this for you?

ealmloff commented 11 months ago

The e-commerce example doesn't run in wasm on the client side. It runs on the server to generate server side rendered pages. You can run it with cargo run or dx serve --platform desktop. (The 0.4 version of the CLI dx serve fixes the hanging issue and gives a more clear error)