kevmo314 / magic-copy

Magic Copy is a Chrome extension that uses Meta's Segment Anything Model to extract a foreground object from an image and copy it to the clipboard.
MIT License
2.44k stars 150 forks source link

The compiled source code cannot run properly. ort.min.js:1802 wasm streaming compile failed: LinkError: WebAssembly.instantiate(): Import #36 module="a" function="K": function import requires a callable #100

Open sunny-fun opened 9 months ago

sunny-fun commented 9 months ago

Hello, I downloaded the source code of your open-source project magic-copy from releases/tag/v1.2.0 and installed dependencies locally. After running npm run watch and adding the plugin to Google Chrome, I found that it doesn't work properly. It shows an error like the one in the screenshot below. Snipaste_2024-02-19_14-00-40

However, if I download the compiled magic-copy-chrome.zip from releases/tag/v1.2.0 and install it directly in the browser, it works fine. I also checked the format of onnxruntime-web inside sandbox.js and found that they are different. Could this be an issue with the version of onnxruntime-web? I tried upgrading to the latest version of onnxruntime-web, but the issue persists. Snipaste_2024-02-19_14-06-28

kevmo314 commented 9 months ago

Yeah this sounds like something broken with the onnxruntime-web API. Does it work at 08d78db9a4aafb89302b0a6d5e813a50672fc2a6? Just one before the onnxruntime-web version bump.

sunny-fun commented 9 months ago

Yeah this sounds like something broken with the onnxruntime-web API. Does it work at 08d78db9a4aafb89302b0a6d5e813a50672fc2a6? Just one before the onnxruntime-web version bump.

3Q, It's been solved, but I didn't delve into what caused it. It seems to be the dependency problem. The npm ci installation can run normally, and the npm i installation will make mistakes