Commit 4b0ac92
fix(web): ignore winit's control-flow exception on WASM init
The live demo showed "Failed to load WebAssembly bundle" with the
message "Using exceptions for control flow, don't mind me. This
isn't actually an error!".
That exception is winit's documented mechanism: on wasm32,
EventLoop::run() never returns, so it throws a JS exception to
unwind the Rust stack and hand control to the browser's event
loop. The app is fully running behind it — our try/catch was just
mis-classifying the benign unwind as a fatal error.
index.html now filters that specific exception (matches "control
flow" / "isn't actually an error") and reveals the canvas instead
of showing the error overlay. Genuine init failures still surface.
No WASM rebuild needed — pure JS-side fix.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent f32bc4b commit 4b0ac92
1 file changed
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
67 | 65 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
0 commit comments