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

Note on using "serde-serialize" feature of wasm-bindgen instead of serde-wasm-bindgen #24

Closed
Wollaston opened this issue Feb 25, 2024 · 1 comment

Comments

@Wollaston
Copy link
Contributor

Hi all,

First, thanks for the cool crate. I have been enjoying experimenting with it in a few of my projects.

An issue I came across is that depending on other project dependencies, using the wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } can cause a "cyclic package dependency" and prevent the project from building (the getrandom crate ends up depending on itself). I did some research on this issue in the Rust Wasm context, and this can be caused by using that serde-deserialize feature of wasm-bindgen. Removing that feature and instead using the serde-wasm-bindgen crate in its place resolves this issue. Making this update on a local branch let my project compile and run without issue. I also tested the leptos-leaflet project examples with this change, and they also seem to run just fine.

Here is some discussion on this issue that helped me resolve it:

I make this issue as the update is not strictly required, but it can lead to a bit of confusion as it comes up depending on the other project dependencies without too much help from the standard Cargo error messages.

I can make a pull request correcting the Cargo.toml for the main library if that would be helpful. Otherwise, anyone else who comes across this issue can make the update locally or in a fork and resolve the issue that way. Thank you again.

@dgsantana
Copy link
Collaborator

Ok, thanks for finding the issue, and I'm glad you are enjoying the crate.

Feel free to make a pull request to fix the Cargo.toml.

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

No branches or pull requests

2 participants