DioxusLabs / DioxusLabs/dioxus

`dx serve` works but `dx bundle` fails

Open
#3,744 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Running

```
dx serve --addr 0.0.0.0 --port 8000
```
is successful. However, running
```
dx bundle
```
in the same project and environment fails on
```
error[E0382]: borrow of moved value: `project`
--> src/components/pages/projects_page.rs:18:17
|
18 | / rsx! {
19 | | div {
20 | | class: "flex flex-col",
21 | | for project in projects {
| | ------- move occurs because `project` has type `Project`, which does not implement the `Copy` trait
... |
30 | | onclick: move |_| project_being_edited.set(Some(project.clone())),
| | -------- value moved into closure here ------- variable moved due to use in closure
... |
34 | | }
35 | | }
| |_________________^ value borrowed here after move
```

**Steps To Reproduce**

Steps to reproduce the behavior:

- Clone the [reproduction repo](https://github.com/matous-volf/todo-baggins/tree/defddfadae8e22f30e5533e79511c77ead2468b0).
- Run
```
docker compose -f docker-compose-dev.yaml up --build
```
(the `dx serve` is the image CMD).
- Wait for the compilation and observe the succesful build at http://localhost:8000.
- Get into the container's shell by running
```
docker compose exec app bash
```
- There, run
```
dx bundle
```

**Expected behavior**

`dx serve` and `dx bundle` should behave consistently – always both either succeed or fail.

**Environment:**

- Dioxus version: 0.6.3
- Rust version: 1.83.0
- OS info: the rust:1.83.0-bookworm Docker image
- App platform: web (fullstack)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.