[CLI] Png, WebP to Avif - BindingError: Cannot pass non-string to std::string
See original GitHub issueDescribe the bug Using squoosh-cli and trying to convert a png / webp to avif. I tried to alter the input options like passing the file name as a string, but to no avail. Converting from png to webp works without errors with the same input options pattern that is described below.
The command starts sucessfully (apparently successful decoding), but throws an error directly after starting the encoding process:
vvvv@maschine24 ~/Documents/KuttBjoern $ squoosh-cli --avif auto Kattbljor_Flip_v011_0000.webp
0/1 ⠏ ▐▨▨▨▨▨╌╌╌╌╌▌ Encoding (4 threads)
Kattbljor_Flip_v011_0000.webp: 241.68KBBindingError: Cannot pass non-string to std::string
at BindingError.<anonymous> (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:268883)
at new BindingError (eval at Tb (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:1:1), <anonymous>:2:34)
at R (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:269189)
at Object.toWireType (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:277225)
at Object.decode (eval at Xa (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:1:1), <anonymous>:5:26)
at decode (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:537777)
at /home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:536028
at async binarySearch (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:535409)
at async autoOptimize (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:535909)
at async encodeFile (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:537821)
Worker error: Error [RuntimeError]: abort(BindingError: Cannot pass non-string to std::string). Build with -s ASSERTIONS=1 for more info.
at process.w (/home/vvvv/.npm-packages/lib/node_modules/@squoosh/cli/build/index.js:7:376640)
at process.emit (events.js:326:22)
at processPromiseRejections (internal/process/promises.js:209:33)
0/1 ⠹ ▐▨▨▨▨▨╌╌╌╌╌▌ Encoding (4 threads)
Kattbljor_Flip_v011_0000.webp: 241.68KB
After the error has occured, the command just continues to run the encoding step (presumably) indefinitely. I let it run for something like 10 minutes without success. A verbose option would be nice.
Version:
- OS w/ version: 5.10.7-3-MANJARO, DE Cinnamon 4.8.6, bash
- Node version: v12.20.1
- npm version: 6.14.11
Additional context, screenshots, screencasts
npx @squoosh/cli --avif auto <file>
acts identically.
On a side note:
npx @squoosh/cli --avif <file>
throws the error “error: missing required argument ‘files’” , which is either not accurate or an error on my side.
Thank you for the awesome work you do!
Edit1:
I also would like to mention, that on the webapp (vanilla Chrome Version 88.0.4324.150 (Official Build) (64-bit) / Firefox 85.0.1 (64-bit)) , the conversion to avif also runs indefinitely without finishing while other conversion run fine, but without throwing an error of course. Could this hint at a missing dependency on my side? Could additional debugging info be outputted to the browser console to make issues like this more transparent?
Edit2:
Are there other utils I should test the conversion with to exclude some possible error sources?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top GitHub Comments
I got the same error when using auto as stated in help text. On win10 it needed single quotes, ie change it to ‘auto’
Regarding your side note, it’s because the command is ambiguous, --avif has an optional config which follows after the --avif flag, it is using your <file> as that config. You can explicitly terminate the option input with a double hyphen, as follows
npx @squoosh/cli --avif -- <file>
Ha, I know what you mean. I also run node under nvm (4 windows), that dynamic duo can be doubly joyful.
Some more info, The previous ver 0.6.1 works fine when run like this
but then trying this:
npx @squoosh/cli@0.6.1 -V
fails just like above
so it seems more likely its a problem when specifying the version with npx, than a new problem with the current build.
I installed it globally with npm and its fine -