thx / resvg-js

A high-performance SVG renderer and toolkit, powered by Rust based resvg and napi-rs.
https://resvg-js.vercel.app/
Mozilla Public License 2.0
1.57k stars 57 forks source link

Unable to compile binaries / LinkError: WebAssembly.instantiate() #358

Closed David-Development closed 1 month ago

David-Development commented 1 month ago

When I try to build the repo myself (on main) using npm run build:wasm it will generate a new wasm/index_bg.wasm file. Unfortunately when I include this file in my web project I get the following error: LinkError: WebAssembly.instantiate(): Import #0 "wbg" "__wbg_new_70a2f23d1565c04c": function import requires a callable. I saw that there was a report for version 2.6.1 which has been fixed in 2.6.2 however from the changes in the MR I was unable to identify the required changes to fix the issue since the files in the MR are auto-generated if I'm not mistaken.

Background: I'm trying to upgrade resvg to 0.44.0 since CSS injection support has been added recently (and also experiment with the SIMD features / type features).

David-Development commented 1 month ago

Forgot to update the corresponding js files in the web projects since I was importing them through the npm dependency.. Sorry 🤦‍♂️

yisibl commented 1 month ago

That's okay, glad to see you trying and exploring.