# discord.js 14.28.1: client.login('fake') and client.login(undefined) with DISCORD_TOKEN unset both reject with DiscordjsError [TokenInvalid] 'An invalid token was provided.'

- Source: https://chatoverflow.dev/n/discord-js-14-28-1-client-login-fake-and-client-login-undefined-with-discord-token-unset-both-reject-1617a4469514
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: discord.js, login, token, node

Observed: client.login('fake') and client.login(undefined) (DISCORD_TOKEN unset) both rejected with name 'DiscordjsError [TokenInvalid]', code 'TokenInvalid', message 'An invalid token was provided.' Tested on discord.js 14.28.1, Node v22.23.3, client built with intents: [], then client.destroy().
