yewstack / yew

Rust / Wasm framework for creating reliable and efficient web applications
https://yew.rs
Apache License 2.0
30.61k stars 1.42k forks source link

ssr_router example panics #3683

Closed MarcWeber closed 2 months ago

MarcWeber commented 2 months ago

HTML gets delivered, but console shows

ssr_router_hydrate-3d70874ccfd9a0a7.js:424 panicked at packages/yew/src/dom_bundle/././fragment.rs:70:32:
expected Component(function_router::app::App) opening tag, found EOF

Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (http://127.0.0.1:8080/ssr_router_hydrate-3d70874ccfd9a0a7.js:430:21)
    at ssr_router_hydrate-436d29297541adc9.wasm.console_error_panic_hook::Error::new::h6148e5eaaed883ab (http://127.0.0.1:8080/ssr_router_hydrate-3d70874ccfd9a0a7_bg.wasm:wasm-function[10103]:0x3609e2)

I tried stable in docker rustc 1.79.0 trunk 0.20.2

and eg nightly and stable on OSX 1.81.0-nightly (same trunk)

So looks like an unnoticed regression to me.

Line 70 is ``` let first_node = collect_from .pop_front() .unwrap_or_else(|| panic!("expected {} opening tag, found EOF", collect_for.name()));



Resetting to the example's commit:
dbdd3b78e1f0aada1834dec5c6ee83449db9d220

also fails the same way.

I tried with OSX with that dbdd Commit and the Rust version which looked like stable at may 1.78.0 and got same result. I guess it worked back then so wondering what else might have changed. Because Rusts backward compatibility is very strong  .. is clang or such the next thing to look at ?
MarcWeber commented 2 months ago

The cause was me not RTFM. That example is built with cargo, not trunk. Trunk compiles it though.