squoosh: squoosh cli windows conversion stuck
Installed on Windows 10 with following cmd: npm i -g @squoosh/cli
Ran squoosh-cli --webp auto pic.png
, which created pic.webp (but it was larger than original png
Then tried squoosh-cli --webp '{"quality":75}' pic.png
It starts but is stuck on 1 thread, even after 30 min:
0/1 | ▐▨▨▨▨▨╌╌╌╌╌▌ Encoding (8 threads)
pic.png: 15.66KB(node:13288) UnhandledPromiseRejectionWarning: Cannot use ‘in’ operator to search for ‘lossless’ in {quality:75}
(Use node --trace-warnings ...
to show where the warning was created)
(node:13288) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejection0/1 / ▐▨▨▨▨▨╌╌╌╌╌▌ Encoding (8 threads)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (3 by maintainers)
Windows here!
Funny, I tried first to reproduce on Powershell and there was no issue.
Then, I opened a regular Command Prompt and found that I could reproduce it.
The problem
TypeError: Cannot use 'in' operator to search for 'lossless' in {quality:75}
:Hmm, so further investigation showed me that using this command:
npx @squoosh/cli --webp "{\"quality\":75}" heaps.png
(notice the double quotes and escaping)makes it work on Windows Command Prompt. The root issue has something to do with CLI arg parsing?
Thanks, @PetrusVermaak.
I can’t reproduce this on MacOS or Linux. So I guess this is an issue with Windows. I don’t have a machine at hand, so if anyone wants to help here, that’d be awesome.