Closed iamshreeram closed 5 months ago
The key to fixing this is buried in the error message:
consider downloading the target with
rustup target add wasm32-unknown-unknown
Thanks @rylev ; Build is successful after adding the wasm32
target. After the cargo build
, the ./target/release
doesnt contain any binary or the ./target/wasm32-unknown-unknown/release/markdown.wasm
file; Is this expected?
Seeing below error while creating component
~/r/p/r/wasmtime-component-demo ❯❯❯ wasm-tools component new ./target/wasm32-unknown-unknown/release/markdown.wasm -o markdown-component.wasm
error: decoding custom section component-type:markdown
Caused by:
0: magic header not detected: bad magic number (at offset 0x0)
And you're running cargo build --target wasm32-unknown-unknown --release -p markdown
or just cargo build
?
@rylev , Yes, Im running cargo build --target wasm32-unknown-unknown --release -p markdown
After restarting my system, markdown.wasm
(2 MB) got built into the target release directory. But, still seeing the same error -
@iamshreeram I had forgotten how out of date all the dependencies I use in this repo are. I updated the dependencies in https://github.com/rylev/wasmtime-component-demo/commit/12a202dee8c7be0463ad440996d685f78bcae045 and everything should work now. Can you pull the latest changes and try again?
@rylev , Yes, this is working well. thanks for fixing. Does the code only transform one line of markdown into HTML?
Additionally, it would be beneficial to include information about the project's functionality and the process of creating components, which will greatly assist beginners.
Indeed the code only reads one line of input and transforms that to markdown. Thanks for the feedback!
@rylev , Seeing below error while building the wasm component -