Open higbee4 opened 7 months ago
Thanks, I'll try take a look at these when I can 👀
Thanks for your patience @higbee4. I've taken a look at it now and cannot reproduce it.
The issue is happening as it appears you have some kind of preprocessor/module bundler that is modifying the package code. The issue is that it's modified the code and tried to define Module
with let
and then again with var
hence the error.
If you are using Vite or Nuxt we recommend disabling transpilation of jsquash modules (See the note in the README)
If you can help with following it help us solve the issue quicker:
Describe the bug When I try to import jpeg or webp inside a web worker, I get this error:
avif and png both work though.
Solution I noticed that avif and png use a slightly different syntax in the enc/dec files and they don't have this problem. I can work on a PR if preferred, or you can just change this inside
jpeg/codec/enc/mozjpeg_enc.js
,jpeg/codec/dec/mozjpeg_dec.js
,webp/codec/enc/webp_enc.js
, andwebp/codec/dec/webp_dec.js
to match the syntax used in avif and png that should fix it. I tried changing them locally and it fixed the problem for me.Change
to
Thanks.