Error: Expected token to be set for this request, but none was present

I'm seeing this error popup on my bot where I use @djs/rest, I'm not entirely sure why it happens or when it happens, it sort of just happens out of nowhere. My bot functions normally as usual, and then every once in a while this error will popup (I use serverless btw). Here's the full error if it helps:

Error: Expected token to be set for this request, but none was present
at _REST.resolveRequest (/app/node_modules/@discordjs/rest/dist/index.js:1367:15)
at _REST.queueRequest (/app/node_modules/@discordjs/rest/dist/index.js:1327:46)
at _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1293:33)
at _REST.post (/app/node_modules/@discordjs/rest/dist/index.js:1267:17)
at Object.execute (/app/commands/edit_submission.js:77:28)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /app/index.js:120:21

Also before you ask yes I updated the package yesterday and it happened again today. I'm also on Node v22.3.0
Was this page helpful?