webtoon / psd

Fast zero-dependency PSD parser for the web and Node.js
https://webtoon.github.io/psd
MIT License
1.21k stars 55 forks source link

node composite error #49

Open younseunghyun opened 2 years ago

younseunghyun commented 2 years ago

hi I'm trying to use this library at server.

When I try to composite psd files, atob reference error is occured.

Also when I change atob to buffer, below error is occured. TypeError: WebAssembly.instantiate(): Import #0 module="./webtoon_psd_decoder_bg.js" error: module is not an object or functiom

How can I use composite?

Thankyou

pastelmind commented 2 years ago

Hello! I believe you are using Node.js < v16. Currently, our bundle uses atob() (which was added in Node v16) to decode the embedded WebAssembly module. This code is emitted by vite-plugin-wasm v1.0.0.

We have since upgraded to a newer version of vite-plugin-wasm, which uses Buffer.from() when possible. This will make our bundle compatible with older versions of Node.js. It's also much faster than atob()!

We have yet to publish a new version containing the fix. I'm aiming to make a new release within a week, however, so please be patient! 🏃

(also see #37)