DioxusLabs / DioxusLabs/dioxus

Index out of bounds panic when hot reloading [0.7.0-rc.0]

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

Description

**Problem**

After making a change `dx serve` fails to reload and logs two panics. Using `dx serve --hotpatch` gives similar results.

Stack Trace

```
09:59:21 [web] panicked at /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-core-0.7.0-rc.0/src/hotreload_utils.rs:287:50:
index out of bounds: the len is 0 but the index is 0

Stack:

__wbg_get_imports/imports.wbg.__wbg_new_8a6f238a6ece86ea/<@http://127.0.0.1:8080/wasm/swords.js:1371:21
logError@http://127.0.0.1:8080/wasm/swords.js:92:18
__wbg_get_imports/imports.wbg.__wbg_new_8a6f238a6ece86ea@http://127.0.0.1:8080/wasm/swords.js:1370:66
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4373]:0x198c67
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[645]:0xbccb0
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[5418]:0x19c853
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[2160]:0x16573b
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[2595]:0x179ad7
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[5260]:0x19c2a0
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3825]:0x194e16
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3826]:0x194e42
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[2939]:0x184d98
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[1029]:0x1008aa
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[1270]:0x11e10a
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[1038]:0x101b74
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[307]:0x77e5
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3773]:0x194404
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4784]:0x19ada7
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[800]:0xdd1eb
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[1077]:0x106a1d
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3272]:0x18c3be
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3770]:0x19438a
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3253]:0x18be51
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3737]:0x193ca4
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[1072]:0x106086
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[668]:0xc22f1
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[660]:0xc0623
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[417]:0x6f0da
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[699]:0xc975f
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[462]:0x8434e
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[679]:0xc4bdb
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[336]:0x34113
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[838]:0xe3c26
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4024]:0x196afa
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4306]:0x198728
__wbg_adapter_70@http://127.0.0.1:8080/wasm/swords.js:340:10
real@http://127.0.0.1:8080/wasm/swords.js:199:20

09:59:21 [web] panicked at /home/paul/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasm-bindgen-futures-0.4.50/src/task/singlethread.rs:103:37:
RefCell already borrowed

Stack:

__wbg_get_imports/imports.wbg.__wbg_new_8a6f238a6ece86ea/<@http://127.0.0.1:8080/wasm/swords.js:1371:21
logError@http://127.0.0.1:8080/wasm/swords.js:92:18
__wbg_get_imports/imports.wbg.__wbg_new_8a6f238a6ece86ea@http://127.0.0.1:8080/wasm/swords.js:1370:66
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4373]:0x198c67
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[645]:0xbccb0
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[5418]:0x19c853
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[2160]:0x16573b
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[2595]:0x179ad7
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[5260]:0x19c2a0
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3825]:0x194e16
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3826]:0x194e42
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[3206]:0x18afe4
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[838]:0xe3d60
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4024]:0x196afa
@http://127.0.0.1:8080/wasm/swords_bg.wasm:wasm-function[4306]:0x198728
__wbg_adapter_70@http://127.0.0.1:8080/wasm/swords.js:340:10
real@http://127.0.0.1:8080/wasm/swords.js:199:20

```

**Steps To Reproduce**

Unknown at the moment, currently trying to reproduce in a separate project and will update this post when I can. Hoping the stack trace is at least somewhat helpful.

**Expected behavior**

Expected dx serve to apply the change to the open pages or reload them without a panic.

**Environment:**

- Dioxus version:
- Rust version: 1.89.0
- OS info: EndeavorOS
- App platform: web + fullstack

**Questionnaire**

I'm interested in fixing this myself but don't know where to start.

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.