markdown-link-check icon indicating copy to clipboard operation
markdown-link-check copied to clipboard

Error: invalid argument type (Array instead of Buffer or Uint8Array)

Open d1nuc0m opened this issue 3 years ago • 1 comments

I tried to check an online markdown file with lots of link (it's an awesome list):

markdown-link-check -p -v https://github.com/awesome-selfhosted/awesome-selfhosted/blob/master/README.md

and it gave an error relative to invalid argument type:

FILE: https://github.com/awesome-selfhosted/awesome-selfhosted/blob/master/README.md
Checking... [==                       ] 6%node:internal/streams/writable:313
      throw new ERR_INVALID_ARG_TYPE(
      ^

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Array
    at new NodeError (node:internal/errors:377:5)
    at _write (node:internal/streams/writable:313:13)
    at Writable.write (node:internal/streams/writable:335:10)
    at PassThrough.ondata (node:internal/streams/readable:766:22)
    at PassThrough.emit (node:events:527:28)
    at Readable.read (node:internal/streams/readable:539:10)
    at PassThrough.<anonymous> (/usr/lib/node_modules/markdown-link-check/node_modules/needle/lib/needle.js:766:32)
    at PassThrough.emit (node:events:527:28)
    at emitReadable_ (node:internal/streams/readable:590:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v18.2.0

d1nuc0m avatar May 18 '22 22:05 d1nuc0m

Might be duplicated with #192

PeterDaveHello avatar Jun 23 '22 14:06 PeterDaveHello

@PeterDaveHello hello, do you have any update on this, this still happen... very appreciated if you can work on this.

tanrobotix avatar Sep 19 '22 14:09 tanrobotix

I've merged the changes into link-check and updated the dependencies of this module. The latest release should fix the problem. If not, please re-open.

tcort avatar Sep 21 '22 09:09 tcort