Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xilem_html: called Option::unwrap() on a None value #97

Closed
jplatte opened this issue Jul 14, 2023 · 6 comments · Fixed by #141
Closed

xilem_html: called Option::unwrap() on a None value #97

jplatte opened this issue Jul 14, 2023 · 6 comments · Fixed by #141

Comments

@jplatte
Copy link
Member

jplatte commented Jul 14, 2023

To reproduce:

  1. Check out jplatte/caniuse.rs@151d9e1
  2. Run cargo xtask serve
  3. Open http://localhost:8000 in a browser
  4. Type he into the search bar
panicked at 'called `Option::unwrap()` on a `None` value', /home/jplatte/.cargo/git/checkouts/xilem-031d790027f85a11/9ec2b46/crates/xilem_html/src/view.rs:101:1

Stack:

__wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f/<@http://localhost:8000/caniuse_rs.js:324:25
logError@http://localhost:8000/caniuse_rs.js:218:22
__wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f@http://localhost:8000/caniuse_rs.js:323:70
console_error_panic_hook::Error::new::h27abc4bf87348d72@http://localhost:8000/caniuse_rs.wasm:wasm-function[2834]:0x18304c
console_error_panic_hook::hook_impl::h43ba58051cd1388d@http://localhost:8000/caniuse_rs.wasm:wasm-function[531]:0x128b63
console_error_panic_hook::hook::h9887356760a490bc@http://localhost:8000/caniuse_rs.wasm:wasm-function[3186]:0x187c38
core::ops::function::Fn::call::h6d7dc1bd32174f07@http://localhost:8000/caniuse_rs.wasm:wasm-function[2673]:0x1808cd
std::panicking::rust_panic_with_hook::h4f13c7ea06df5ea7@http://localhost:8000/caniuse_rs.wasm:wasm-function[1131]:0x153b59
std::panicking::begin_panic_handler::{{closure}}::h875ead8fb0e54a1b@http://localhost:8000/caniuse_rs.wasm:wasm-function[1468]:0x162eca
std::sys_common::backtrace::__rust_end_short_backtrace::hdbc4415a966db8e6@http://localhost:8000/caniuse_rs.wasm:wasm-function[3481]:0x18a2ac
rust_begin_unwind@http://localhost:8000/caniuse_rs.wasm:wasm-function[2400]:0x17b9aa
core::panicking::panic_fmt::h3ac518bea88a26d3@http://localhost:8000/caniuse_rs.wasm:wasm-function[3028]:0x185c0b
core::panicking::panic::he7d1dc94b47dab2b@http://localhost:8000/caniuse_rs.wasm:wasm-function[2671]:0x18084e
core::option::Option<T>::unwrap::ha4e9a4f9516eb2be@http://localhost:8000/caniuse_rs.wasm:wasm-function[1729]:0x16b66c
<V as xilem_html::view::ViewSequence<T,A>>::rebuild::h703ac3023a0b4a91@http://localhost:8000/caniuse_rs.wasm:wasm-function[1505]:0x1645a9
<xilem_html::view::Either<V1,V2> as xilem_html::view::ViewSequence<T,A>>::rebuild::h37524240aec8e392@http://localhost:8000/caniuse_rs.wasm:wasm-function[144]:0xe4a34
<alloc::vec::Vec<VT> as xilem_html::view::ViewSequence<T,A>>::rebuild::he261c11a5222fea6@http://localhost:8000/caniuse_rs.wasm:wasm-function[139]:0xe227e
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::{{closure}}::hdb6d8a2092696972@http://localhost:8000/caniuse_rs.wasm:wasm-function[2215]:0x177ab8
xilem_html::context::Cx::with_id::hc06e00db7b9b037f@http://localhost:8000/caniuse_rs.wasm:wasm-function[2119]:0x175753
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::h79ef49156e802e83@http://localhost:8000/caniuse_rs.wasm:wasm-function[72]:0xacb9f
<xilem_html::element::elements::Div<ViewSeq> as xilem_html::view::View<T_,A_>>::rebuild::hd1b3dd34f133147e@http://localhost:8000/caniuse_rs.wasm:wasm-function[2053]:0x173dcf
<V as xilem_html::view::ViewSequence<T,A>>::rebuild::hefbd7aeecd1405e6@http://localhost:8000/caniuse_rs.wasm:wasm-function[1450]:0x16236b
<(V0,V1) as xilem_html::view::ViewSequence<T,A>>::rebuild::h850edb6ff1963b62@http://localhost:8000/caniuse_rs.wasm:wasm-function[1207]:0x157765
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::{{closure}}::h7d1c1415c6a21e9e@http://localhost:8000/caniuse_rs.wasm:wasm-function[2199]:0x1774f8
xilem_html::context::Cx::with_id::h6c6da227a22e67e7@http://localhost:8000/caniuse_rs.wasm:wasm-function[2110]:0x1753e1
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::hfbd1b4127bf100c6@http://localhost:8000/caniuse_rs.wasm:wasm-function[87]:0xc0cae
<xilem_html::element::elements::Div<ViewSeq> as xilem_html::view::View<T_,A_>>::rebuild::hd8fa718e58ca4c35@http://localhost:8000/caniuse_rs.wasm:wasm-function[2054]:0x173e33
<V as xilem_html::view::ViewSequence<T,A>>::rebuild::he6cf050c5a893576@http://localhost:8000/caniuse_rs.wasm:wasm-function[1449]:0x1622c5
<alloc::vec::Vec<VT> as xilem_html::view::ViewSequence<T,A>>::rebuild::h1d5c8d5bb38b5065@http://localhost:8000/caniuse_rs.wasm:wasm-function[138]:0xe1a82
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::{{closure}}::haf75742e4cdce3c4@http://localhost:8000/caniuse_rs.wasm:wasm-function[2207]:0x1777d8
xilem_html::context::Cx::with_id::h25134a75fb6d0cf9@http://localhost:8000/caniuse_rs.wasm:wasm-function[2103]:0x175133
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::h5ce3dde0c3f17596@http://localhost:8000/caniuse_rs.wasm:wasm-function[70]:0xaa0db
<xilem_html::element::elements::Div<ViewSeq> as xilem_html::view::View<T_,A_>>::rebuild::h6f8797c1a3ba9197@http://localhost:8000/caniuse_rs.wasm:wasm-function[2050]:0x173ca3
<V as xilem_html::view::ViewSequence<T,A>>::rebuild::h8c2495bae530a2dd@http://localhost:8000/caniuse_rs.wasm:wasm-function[1440]:0x161cea
<caniuse_rs::either::Either3<V1,V2,V3> as xilem_html::view::ViewSequence<T,A>>::rebuild::h32910340dfcb300e@http://localhost:8000/caniuse_rs.wasm:wasm-function[93]:0xc7574
<(V0,V1) as xilem_html::view::ViewSequence<T,A>>::rebuild::h0b23fe7227f9e5cd@http://localhost:8000/caniuse_rs.wasm:wasm-function[1201]:0x15730a
<caniuse_rs::either::Either3<V1,V2,V3> as xilem_html::view::ViewSequence<T,A>>::rebuild::hacfa139821938acb@http://localhost:8000/caniuse_rs.wasm:wasm-function[157]:0xe9bbf
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::{{closure}}::hd699b74762b0df24@http://localhost:8000/caniuse_rs.wasm:wasm-function[2213]:0x177a00
xilem_html::context::Cx::with_id::h25a7bb8f96f2439b@http://localhost:8000/caniuse_rs.wasm:wasm-function[2104]:0x175195
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::hef4d11aa00abe777@http://localhost:8000/caniuse_rs.wasm:wasm-function[83]:0xbb704
<xilem_html::element::elements::Div<ViewSeq> as xilem_html::view::View<T_,A_>>::rebuild::ha22503a13f142a31@http://localhost:8000/caniuse_rs.wasm:wasm-function[2051]:0x173d07
<V as xilem_html::view::ViewSequence<T,A>>::rebuild::had6835093d51d113@http://localhost:8000/caniuse_rs.wasm:wasm-function[1442]:0x161e37
<(V0,V1) as xilem_html::view::ViewSequence<T,A>>::rebuild::h2b4614dfb3efc8e9@http://localhost:8000/caniuse_rs.wasm:wasm-function[1204]:0x15755b
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::{{closure}}::h255d733b12ee1247@http://localhost:8000/caniuse_rs.wasm:wasm-function[2190]:0x1771bc
xilem_html::context::Cx::with_id::h9b371f762466f73d@http://localhost:8000/caniuse_rs.wasm:wasm-function[2116]:0x17562d
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::rebuild::h5b0b6481dfb6e7f9@http://localhost:8000/caniuse_rs.wasm:wasm-function[69]:0xa8b76
<xilem_html::element::elements::Main<ViewSeq> as xilem_html::view::View<T_,A_>>::rebuild::hdb9fadd76598af11@http://localhost:8000/caniuse_rs.wasm:wasm-function[2060]:0x17408b
<xilem_html::app::App<T,V,F> as xilem_html::app::AppRunner>::handle_message::hb2fbc62780306995@http://localhost:8000/caniuse_rs.wasm:wasm-function[252]:0x102f67
xilem_html::context::MessageThunk::push_message::h4ac8777da238898b@http://localhost:8000/caniuse_rs.wasm:wasm-function[1119]:0x15311b
<xilem_html::event::OnEvent<E,V,F> as xilem_html::view::View<T,A>>::build::{{closure}}::hb767d9056dde59c8@http://localhost:8000/caniuse_rs.wasm:wasm-function[1570]:0x166a0d
<dyn core::ops::function::FnMut<(&A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h97e9d7d3b1ade7cd@http://localhost:8000/caniuse_rs.wasm:wasm-function[977]:0x14b0ae
__wbg_adapter_16@http://localhost:8000/caniuse_rs.js:247:18
real@http://localhost:8000/caniuse_rs.js:201:24
EventListener.handleEvent*__wbg_get_imports/imports.wbg.__wbg_addEventListener_a5963e26cd7b176b/<@http://localhost:8000/caniuse_rs.js:532:29
handleError@http://localhost:8000/caniuse_rs.js:265:22
__wbg_get_imports/imports.wbg.__wbg_addEventListener_a5963e26cd7b176b@http://localhost:8000/caniuse_rs.js:531:83
web_sys::features::gen_EventTarget::EventTarget::add_event_listener_with_callback_and_add_event_listener_options::h92e6149a74053ae2@http://localhost:8000/caniuse_rs.wasm:wasm-function[567]:0x12c275
gloo_events::EventListener::raw_new::hb1d3fac9f2700c4e@http://localhost:8000/caniuse_rs.wasm:wasm-function[394]:0x1197df
gloo_events::EventListener::new::{{closure}}::hfb15f6de51805b15@http://localhost:8000/caniuse_rs.wasm:wasm-function[971]:0x14aaee
std::thread::local::LocalKey<T>::try_with::ha7f1cd495a121d84@http://localhost:8000/caniuse_rs.wasm:wasm-function[344]:0x112a4c
std::thread::local::LocalKey<T>::with::ha25abea5ab0c3152@http://localhost:8000/caniuse_rs.wasm:wasm-function[554]:0x12aea5
gloo_events::EventListener::new::h8f2e5d6050e28b3b@http://localhost:8000/caniuse_rs.wasm:wasm-function[714]:0x138ba7
<xilem_html::event::OnEvent<E,V,F> as xilem_html::view::View<T,A>>::build::h6965fa3e958b910f@http://localhost:8000/caniuse_rs.wasm:wasm-function[155]:0xe9034
<xilem_html::event::events::OnInput<T,A,V,F,OA> as xilem_html::view::View<T,A>>::build::h28c3e82f1e351a19@http://localhost:8000/caniuse_rs.wasm:wasm-function[2781]:0x18236a
<V as xilem_html::view::ViewSequence<T,A>>::build::h4158e2e06ccf9658@http://localhost:8000/caniuse_rs.wasm:wasm-function[236]:0xff92b
<(V0,V1) as xilem_html::view::ViewSequence<T,A>>::build::h9c0068cfd11082e8@http://localhost:8000/caniuse_rs.wasm:wasm-function[240]:0x100675
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::{{closure}}::h127494c3a8dd5651@http://localhost:8000/caniuse_rs.wasm:wasm-function[2352]:0x17a9a3
xilem_html::context::Cx::with_new_id::h83854c07f83250a4@http://localhost:8000/caniuse_rs.wasm:wasm-function[1264]:0x15a336
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::hb9b9c1c6ae944c44@http://localhost:8000/caniuse_rs.wasm:wasm-function[125]:0xdaf08
<xilem_html::element::elements::Div<ViewSeq> as xilem_html::view::View<T_,A_>>::build::h185925b41262e684@http://localhost:8000/caniuse_rs.wasm:wasm-function[2758]:0x181dcc
<V as xilem_html::view::ViewSequence<T,A>>::build::h1e29596e46fcdbea@http://localhost:8000/caniuse_rs.wasm:wasm-function[958]:0x149daf
<(V0,V1) as xilem_html::view::ViewSequence<T,A>>::build::h4dc73693a2cd716a@http://localhost:8000/caniuse_rs.wasm:wasm-function[534]:0x128fef
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::{{closure}}::h6c3dd079c0c49188@http://localhost:8000/caniuse_rs.wasm:wasm-function[2363]:0x17ad55
xilem_html::context::Cx::with_new_id::hcfdd931836917f28@http://localhost:8000/caniuse_rs.wasm:wasm-function[1269]:0x15a70b
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::hc52a43a992242fa7@http://localhost:8000/caniuse_rs.wasm:wasm-function[137]:0xe1163
<xilem_html::element::elements::Div<ViewSeq> as xilem_html::view::View<T_,A_>>::build::hd30d367e925935ba@http://localhost:8000/caniuse_rs.wasm:wasm-function[2767]:0x181ffd
<V as xilem_html::view::ViewSequence<T,A>>::build::h014c455f65f3b306@http://localhost:8000/caniuse_rs.wasm:wasm-function[1046]:0x14f10f
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::{{closure}}::h38c86573d113ca68@http://localhost:8000/caniuse_rs.wasm:wasm-function[2358]:0x17aba7
xilem_html::context::Cx::with_new_id::hcc2cbeb37a6764c1@http://localhost:8000/caniuse_rs.wasm:wasm-function[1268]:0x15a646
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::hbe76d5f06bf1f59b@http://localhost:8000/caniuse_rs.wasm:wasm-function[136]:0xe093f
<xilem_html::element::elements::Header<ViewSeq> as xilem_html::view::View<T_,A_>>::build::h013b637f909bb0e5@http://localhost:8000/caniuse_rs.wasm:wasm-function[2775]:0x1821f0
<V as xilem_html::view::ViewSequence<T,A>>::build::haf66c7ce9f9eda8a@http://localhost:8000/caniuse_rs.wasm:wasm-function[1047]:0x14f1fe
<(V0,V1) as xilem_html::view::ViewSequence<T,A>>::build::habb10c8714a92368@http://localhost:8000/caniuse_rs.wasm:wasm-function[629]:0x1319b4
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::{{closure}}::h72062840b3ea4b4f@http://localhost:8000/caniuse_rs.wasm:wasm-function[2364]:0x17adab
xilem_html::context::Cx::with_new_id::h242f0a0485ac6697@http://localhost:8000/caniuse_rs.wasm:wasm-function[1258]:0x159e9c
<xilem_html::element::Element<El,Children> as xilem_html::view::View<T,A>>::build::hbbdb89055df7b294@http://localhost:8000/caniuse_rs.wasm:wasm-function[131]:0xde051
<xilem_html::element::elements::Main<ViewSeq> as xilem_html::view::View<T_,A_>>::build::h23d7270daf43f452@http://localhost:8000/caniuse_rs.wasm:wasm-function[2771]:0x1820f7
xilem_html::app::AppInner<T,V,F>::ensure_app::hb0f6f25139ff428e@http://localhost:8000/caniuse_rs.wasm:wasm-function[313]:0x10db54
xilem_html::app::App<T,V,F>::run::hc895366a05421a85@http://localhost:8000/caniuse_rs.wasm:wasm-function[1017]:0x14d76e
caniuse_rs::run::hd6d283b75717c90e@http://localhost:8000/caniuse_rs.wasm:wasm-function[954]:0x149a46
run@http://localhost:8000/caniuse_rs.wasm:wasm-function[3245]:0x188828
run@http://localhost:8000/caniuse_rs.js:256:14
main@http://localhost:8000/caniuse_rs.js:687:13
async*@http://localhost:8000/caniuse_rs.js:689:9
@http://localhost:8000/caniuse_rs.js:697:3


caniuse_rs.js:318:25
@Philipp-M
Copy link
Contributor

Is it anyhow possible that line numbers are added in the trace, so that it's easier to debug?

@jplatte
Copy link
Member Author

jplatte commented Jul 15, 2023

I don't know for sure. For xtask serve, I use wasm-pack build --target web --dev. Maybe it has other flags besides --dev for debugging (not at a computer now so can't check). I didn't customize the dev profile in Cargo.toml, so from rustc's perspective all debugging info should already be enabled.

@jplatte
Copy link
Member Author

jplatte commented Jul 17, 2023

Looks like line numbers in stack traces need better DWARF support in wasm-bindgen, which is blocked on rustwasm/wasm-bindgen#3483, itself blocked on rustwasm/walrus#247.

@Philipp-M
Copy link
Contributor

As there's a lot of bug-fixes in #141 as well, could you try it out with that PR, maybe it fixes this issue?

@jplatte
Copy link
Member Author

jplatte commented Nov 8, 2023

Will do!

@jplatte
Copy link
Member Author

jplatte commented Nov 8, 2023

Looks like this is indeed fixed by #141 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants