Closed jd1900 closed 1 year ago
Sorry about that. Just pushed an update that should fix the filesystem error when passing in a buffer. If it works, I'll push it to npm proper.
As for NextJS... the browser detection is fairly primitive - the only reliable way I could find was simply checking if the global variable 'window' is defined, and assuming a browser if so. Hardly fool-proof, as your NextJS issue proves, since it only tries to resolve 'fs' if it detects a browser. I'm open to suggestions on better detection for this.
Thank you! I'll try to test it and let you know.
I'm unable to test it as the version is still not the new one.
I've tried directly applying the patch on webp.js but I couldn't manage to use the new version, as the built version didn't change.
@ApeironTsuka Could you push to npm?
Sorry - it's pushed now. Been a bit sick this week.
It works now, thank you!
I'm trying to use it in a NextJS project.
First, to avoid the "Module not found: Can't resolve 'fs'" in a Next.js application I added this:
However, when I try to load, as the loadBuffer is not available anymore, I can't.
For example:
Raises this error:
It would be great to add ECMAScript module support.