1Password / op-js

A JS library powered by the 1Password CLI
https://developer.1password.com/docs/cli
MIT License
91 stars 8 forks source link

Creating item fails: invalid JSON #143

Closed fmaximus closed 9 months ago

fmaximus commented 1 year ago

Your environment

op-js version: 0.1.9

CLI version: 2.19.0

OS: Windows

What happened?

CLI returns error 'Failed to create item: invalid JSON'.

What did you expect to happen?

Item created successfully

Steps to reproduce

Call item.create().

Notes & Logs

Since 2.6.2, CLI supports passing fields via arguments rather than JSON piped input. Seems not passing input fails.

Changing stdio option passed to child_process.spawnSync from "pipe" to ["ignore", "pipe", "pipe"] solves the issue.

fmaximus commented 1 year ago

Causes https://github.com/1Password/op-vscode/issues/100

catagris commented 11 months ago

I seem to be having this issue with the VS Code 1Password extension.