Discord bot token error

I have this issue, i can’t find the problem.

SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions…js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3

weird, doesn’t it usually give a file + line number for syntax errors?

try running a js syntax check on the file you’re running

I was a few minutes checking Syntax, or lines, or errors. But there’s nothing, everything’s seems good.

could it be from running something other than the file you looked at? that’d would be consistent with there not being an obvious file name in the error. any idea what it could be running?

I was thinking about other project with same token, but i already changed the token so i don’t know what it could be.

token here refers to an element of the programming language’s syntax, not a secret string used in authentication

Then i don’t know, i don’t have any idea of what it could be.

Online Node.js Compiler

here’s a sample broken script, you can try running it

/* Simple Hello World in Node.js */
console.log(*);

(I’ve replaced the string with an asterisk)

this gets split up into tokens:

  • /* Simple Hello World in Node.js */ - a comment
  • console - an identifier
  • . - dot
  • log - an identifier
  • ( - parenthesis
  • * - asterisk
  • ) - parenthesis
  • ; - semicolon

these are all tokens. certain patterns of tokens are meaningful, and you can run them as programs. not this sequence of patterns though. usually the asterisk is an operator for multiplying things (or possibly newfangled generator-related syntax) but there are no operands here—nothing to multiply together. it doesn’t have a meaning as a program.

usually the interpreter will tell you about where things went wrong, to the effect of “it made sense up until this point.” running this snippet gives:

/home/cg/root/650107a183006/main.js:2
console.log(*);
            ^

SyntaxError: Unexpected token '*'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

(that path being where tutorialspoint apparently saves your script in this tool) but see, it usually shows what file, what line, and in this case even a snippet of the code from that line

Nope, i tried many things but nothing happens.

did you come across any other information about what’s the script where this error is?