Dioxus: Difference between revisions

From NixOS Wiki
Initial setup.
 
Document easiest solution to solving wasm-bindgen version issue
Line 1: Line 1:
[https://dioxuslabs.com Dioxus] is a fullstack app framework for web, desktop, mobile, and more.
[https://dioxuslabs.com Dioxus] is a full-stack Rust app framework for web, desktop, mobile, and more.
 
=== Troubleshooting ===
 
==== ''wasm-bindgen'' mismatch ====
A common issue with using the ''dioxus-cli'' version from Nixpkgs is encountering the following error:<syntaxhighlight lang="text">
it looks like the Rust project used to create this Wasm file was linked against
version of wasm-bindgen that uses a different bindgen format than this binary:
 
  rust Wasm file schema version: 0.2.99
    this binary schema version: 0.2.97
</syntaxhighlight>There are two solutions to solving this:
 
# Pin ''wasm-bindgen'' to the version the ''dioxus-cli'' expects.
# Update ''dioxus-cli'' to use a newer lock file.
 
===== Pinning ''wasm-bindgen'' =====
Within your ''Cargo.toml'' file, force ''wasm-bindgen'' to use the expected version.<syntaxhighlight lang="toml">
[dependencies]
wasm-bindgen = "=0.2.97"
 
</syntaxhighlight>Run ''cargo update'', and you should see the version being downgraded.<syntaxhighlight lang="text">
Updating wasm-bindgen v0.2.97 -> v0.2.99
</syntaxhighlight>
[[Category:Applications]]
[[Category:Applications]]

Revision as of 17:08, 24 December 2024

Dioxus is a full-stack Rust app framework for web, desktop, mobile, and more.

Troubleshooting

wasm-bindgen mismatch

A common issue with using the dioxus-cli version from Nixpkgs is encountering the following error:

it looks like the Rust project used to create this Wasm file was linked against
version of wasm-bindgen that uses a different bindgen format than this binary:

  rust Wasm file schema version: 0.2.99
     this binary schema version: 0.2.97

There are two solutions to solving this:

  1. Pin wasm-bindgen to the version the dioxus-cli expects.
  2. Update dioxus-cli to use a newer lock file.
Pinning wasm-bindgen

Within your Cargo.toml file, force wasm-bindgen to use the expected version.

[dependencies]
wasm-bindgen = "=0.2.97"

Run cargo update, and you should see the version being downgraded.

Updating wasm-bindgen v0.2.97 -> v0.2.99