Unexpected token ILLEGAL

nodejs

#1

So I have a bot which runs on javascript and this bot is used in an app called discord. This is the error I get in the console:

error: uncaughtException: Unexpected token ILLEGAL date=Sat Jan 23 2016 08:20:29 GMT+0000 (UTC), pid=14752, uid=1000, gid=1000, cwd=/home/ubuntu/workspace, execPath=/home/ubuntu/.nvm/versions/node/v4.2.4/bin/node, version=v4.2.4, argv=[/home/ubuntu/.nvm/versions/node/v4.2.4/bin/node, /home/ubuntu/workspace/DougBot.js], rss=52711424, heapTotal=25935456, heapUsed=18505888, loadavg=[2.3935546875, 3.0810546875, 3.40185546875], uptime=205291, trace=[column=16, file=vm.js, function=exports.runInThisContext, line=53, method=runInThisContext, native=false, column=25, file=module.js, function=Module._compile, line=414, method=_compile, native=false, column=10, file=module.js, function=Object.Module._extensions..js, line=442, method=Module._extensions..js, native=false, column=32, file=module.js, function=Module.load, line=356, method=load, native=false, column=12, file=module.js, function=Function.Module._load, line=313, method=Module._load, native=false, column=17, file=module.js, function=Module.require, line=366, method=require, native=false, column=17, file=module.js, function=require, line=385, method=null, native=false, column=16, file=/home/ubuntu/workspace/DougBot.js, function=, line=10, method=null, native=false, column=26, file=module.js, function=Module._compile, line=435, method=_compile, native=false, column=10, file=module.js, function=Object.Module._extensions..js, line=442, method=Module._extensions..js, native=false], stack=[SyntaxError: Unexpected token ILLEGAL,     at exports.runInThisContext (vm.js:53:16),     at Module._compile (module.js:414:25),     at Object.Module._extensions..js (module.js:442:10),     at Module.load (module.js:356:32),     at Function.Module._load (module.js:313:12),     at Module.require (module.js:366:17),     at require (module.js:385:17),     at Object.<anonymous> (/home/ubuntu/workspace/DougBot.js:10:16),     at Module._compile (module.js:435:26),     at Object.Module._extensions..js (module.js:442:10)]

#2

That’s a pretty generic error so you’ll have to post some of your code to even have a fighting chance finding a solution here :wink:

Maybe paste some code here and if there’s no help here then you also could try Stack Overflow as this would be a good fit there as well (just be sure to be more specific).