prettierd: Unable to run prettierd run with a prettierrc configuration.

Prettierd runs fine when I provide no .prettierrc.json, but when I add the file in my root I get the following error -

C:\Users\yashg\AppData\Local\nvim>prettierd test\foo.ts
TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be an instance of Array. Received null
    at Function.concat (buffer.js:550:11)
    at Object.readFileAfterClose (internal/fs/read_file_context.js:51:23)
    at tick (internal/fs/read_file_context.js:105:28)
    at processTicksAndRejections (internal/process/task_queues.js:79:21) {
  code: 'ERR_INVALID_ARG_TYPE'
}

I am using Neovim in Windows along with efm-language-server My configuration of prettier looks like -

{formatCommand = "prettierd ${INPUT}", formatStdin = true}

Any idea?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 5
  • Comments: 15 (7 by maintainers)

Most upvoted comments

@jvmiert I’ll try to spin up a windows vm to investigate this. Sorry for the back and forth.

...\frontend\pages› prettierd.cmd .\login.tsx
TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be an instance of Array. Received null
    at Function.concat (node:buffer:536:3)
    at Object.readFileAfterClose (node:internal/fs/read_file_context:56:23)
    at tick (node:internal/fs/read_file_context:115:9)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_INVALID_ARG_TYPE'
}

🤔 this should work, or at least it used to. I’ll dig into it, but can you share your prettier config to help reproducing the error message? Thanks!

Maybe it’s a windows thing?

{
  "endOfLine": "lf",
  "semi": true,
  "singleQuote": false,
  "tabWidth": 2,
  "trailingComma": "es5"
}