DioxusLabs / example-projects

Featured Dioxus projects on how to build clean user interfaces in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

e-commerce example won't compile

ra0x3 opened this issue · comments

commented

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:

  • Pull down the repo
  • cd ecommerce
  • dioxus serve

Expected behavior

  • I would expect the app to compile and for me to be given a link to the app in the browser

Screenshots

  • Output is below.
  • It hangs at Compiling ahash 0.7.6 (registry+https://github.com/rust-lang/crates.io-index) for about an hour
dioxus serve

[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

  • 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

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

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)