DioxusLabs / DioxusLabs/dioxus
External component breaks fullstack with custom Tokio/Axum
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
**Steps To Reproduce**
Given two crates and they are using the latest commit https://github.com/DioxusLabs/dioxus/commit/9816b402fc6bfd6bd3aad38d2612709f16dff296 (latest or alpha2, doesn't make a difference)
1. A UI lib crate https://github.com/chungwong/rayquaza
2. A consumer crate https://github.com/chungwong/myrust which uses the ui crate
On its own, the ui crate is working good.
```bash
❯ git clone https://github.com/chungwong/rayquaza.git
❯ cd rayquaza/crates/ui
❯ dx-9816b40 -V
dioxus 0.6.0-alpha.2 (9816b40)
❯ npm install
❯ npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch
❯ dx-9816b40 serve --example tabs
```
You will see the the Tab is responsive and its content is changing on http://localhost:8080
---
Let's try to consume the ui crate, and run it as an example.
```bash
❯ git clone https://github.com/chungwong/myrust.git
❯ cd myrust
❯ npm install
❯ npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch
❯ dx-9816b40 serve --example tabs
```
On http://localhost:8080, the tab still works
## Issue
```bash
❯ cd myrust
❯ dx-9816b40 serve
```
On http://localhost:3000 ([port has to change](https://github.com/chungwong/myrust/blob/main/src/main.rs#L53), it cannot be 8080 anymore, may deserve another issue, it is conflicting with the new asset server which is also on 8080),
you will notice the tab is no longer responive and just broken.
Naturally, one may think the UI crate got problem, is it? Let's test it.
Turn this [main](https://github.com/chungwong/myrust/blob/main/src/main.rs#L34-L36) on and let's run it again
```bash
❯ dx-9816b40 serve
```
This time, it is http://localhost:8080 again and you will see the tab works again.
The problem is so strange, there is no error, neither in the terminal or the browser side. It looks like it is related to the tokio/axum side but I cannot be sure.
**Environment:**
- Dioxus version: master@9816b4
- Rust version: 1.80
- OS info: debian 12
- App platform: fullstack
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.