guide icon indicating copy to clipboard operation
guide copied to clipboard

fix error ERR_INVALID_ARG_TYPE

Open gnomerock opened this issue 2 years ago • 3 comments

node v16.17.0 undici v5.10.0

have error

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Array
    at new NodeError (node:internal/errors:387:5)
    at Function.byteLength (node:buffer:740:11)
    at AsyncWriter.write (/Users/gnomerock/Repositories/nomubot/node_modules/undici/lib/client.js:1613:24)
    at writeIterable (/Users/gnomerock/Repositories/nomubot/node_modules/undici/lib/client.js:1574:19) {
  code: 'ERR_INVALID_ARG_TYPE'
}

so I think it should be converted to string first

gnomerock avatar Sep 11 '22 19:09 gnomerock

is it working then?

jaw0r3k avatar Sep 12 '22 15:09 jaw0r3k

I have the same problem, when I applied the change on my end I got

{ message: '401: Unauthorized', code: 0 }

so it's semi-working

MashdorDev avatar Sep 20 '22 13:09 MashdorDev

as i know params are in url https://discord.com/api/oauth2/token?**params** and node fetch accepted params in body, but undici not

jaw0r3k avatar Sep 22 '22 17:09 jaw0r3k

superseded by https://github.com/discordjs/guide/pull/1303 which also changes the code sample

almostSouji avatar Oct 19 '22 10:10 almostSouji