DEV Community

Discussion on: YEW Tutorial: 07 Custom like a bike

Collapse
 
alxrod profile image
Alex Rodriguez

Great tutorial. Was really helpful for me. Only problem I had was that the API doesn't provide the id, age, or salary as a string. Since it puts it out as an integer, I had to change the Employee struct to i32 for those fields. I really liked the tutorial but I just wanted to put this out there for anyone who got stuck with the fetch error that it couldn't deserialize. It took me way longer than it should have for me to realize it was only an issue with the fields being differently typed.

Collapse
 
davidedelpapa profile image
Davide Del Papa

Thank you for taking the time to report this.
I have looked into the matter, but the actual API have not changed, it still gives string-wrapped numbers, so I cannot re-create your problem. Can you please show me the piece of code you are having troubles with?

While working on this I discovered instead that Yew and Yewtil have buped up version, and also that there is a bug introduced few hours ago in wasm-bindgen that clashes with gloo-events bringing down the whole dependency tree! It was introduced in the version 0.2.66 released yesterday.

I'm working on fixing the article, but for now, here is the whole Cargo.toml dependencies section:

[dependencies]
wasm-bindgen = "=0.2.65"
serde="1"
yew = { git = "https://github.com/yewstack/yew", features = ["web_sys"], tag = "0.17.2" }
yewtil = { git = "https://github.com/yewstack/yew", features = ["all", "yewtil-macro"], tag = "0.17.2" }

With this, a cargo clean followed again by a ./run.sh will clear all, download and build again the whole dependencies. It will take time, and it is bandwidth consuming (if you are on mobile bridge) but it should work fine with the last branch of the repo.