guide
guide copied to clipboard
fix error ERR_INVALID_ARG_TYPE
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
is it working then?
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
as i know params are in url
https://discord.com/api/oauth2/token?**params**
and node fetch accepted params in body, but undici not
superseded by https://github.com/discordjs/guide/pull/1303 which also changes the code sample