kleisauke / wasm-vips

libvips for the browser and Node.js, compiled to WebAssembly with Emscripten.
https://kleisauke.github.io/wasm-vips/
MIT License
519 stars 26 forks source link

Error: need to see wasm magic number #64

Closed Sparkenstein closed 9 months ago

Sparkenstein commented 9 months ago

No idea why I am suddenly getting the following error:

image

I have used this library about a year ago, and it worked fine for me, today I upgraded deps and the lib is not working anymore.

I am using vite+react +typescript. do I need specific vite config? I get the same error regardless how I import vips in index.html (es6 or not).

PS: it works just fine if I import wasm-vips in the react component where I need vips. But then I can't get to build the project, it crashes with JS heap out of memory. So importing in index is my only option, I believe.

Sparkenstein commented 9 months ago

nvm I believe by using locateFile I can pick worker and wasm files from different location. I am assuming above error is some verification error, earlier main file was trying to import /vips.wasm but vite server was returning HTML 404 doc.

anyway closing the issue I guess it's solved now.