Ask coding questions

← Back to all posts
SyntaxError: Unexpected token '?'
sergihejo

I'm trying to run my discord bot, but everytime I try it the console gives me this error:
/home/runner/TrapezonBOT/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'

I have my token as an Environment Variable.
How can I fix that error?

Thank you.

Voters
Sr-Pedrocas
sergihejo
Comments
hotnewtop
xyzTeam1