TychoTheTaco / Twitch-Drops-Bot

A Node.js bot that will automatically watch Twitch streams and claim drop rewards.
MIT License
281 stars 37 forks source link

SyntaxError: Bad escaped character in JSON at position 21 at JSON.parse [Bug] #273

Open SwiftExplorer567 opened 1 year ago

SwiftExplorer567 commented 1 year ago

I cannot run the code due to the error:

[2022-12-27 18:46:14] [error] Failed to read config file!
[2022-12-27 18:46:14] [error] SyntaxError: Bad escaped character in JSON at position 21
    at JSON.parse (<anonymous>)
    at ConfigurationParser.parse (file:///C:/Users/Hasan/OneDrive/Masa%C3%BCst%C3%BC/Twitch-Drops-Bot-dev/dist/configuration_parser.js:57:31)
    at file:///C:/Users/Hasan/OneDrive/Masa%C3%BCst%C3%BC/Twitch-Drops-Bot-dev/dist/index.js:351:42
    at Generator.next (<anonymous>)
    at file:///C:/Users/Hasan/OneDrive/Masa%C3%BCst%C3%BC/Twitch-Drops-Bot-dev/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (file:///C:/Users/Hasan/OneDrive/Masa%C3%BCst%C3%BC/Twitch-Drops-Bot-dev/dist/index.js:3:12)
    at main (file:///C:/Users/Hasan/OneDrive/Masa%C3%BCst%C3%BC/Twitch-Drops-Bot-dev/dist/index.js:348:12)
    at file:///C:/Users/Hasan/OneDrive/Masa%C3%BCst%C3%BC/Twitch-Drops-Bot-dev/dist/index.js:706:5
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Changed the location and the error:

[2022-12-27 18:51:01] [error] Failed to read config file!
[2022-12-27 18:51:01] [error] SyntaxError: Bad escaped character in JSON at position 21
    at JSON.parse (<anonymous>)
    at ConfigurationParser.parse (file:///C:/Twitch-Drops-Bot-dev/dist/configuration_parser.js:57:31)
    at file:///C:/Twitch-Drops-Bot-dev/dist/index.js:351:42
    at Generator.next (<anonymous>)
    at file:///C:/Twitch-Drops-Bot-dev/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (file:///C:/Twitch-Drops-Bot-dev/dist/index.js:3:12)
    at main (file:///C:/Twitch-Drops-Bot-dev/dist/index.js:348:12)
    at file:///C:/Twitch-Drops-Bot-dev/dist/index.js:706:5
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
jaredcat commented 1 year ago

Your config file is messed up. Paste it into there and see if you can fix it: https://jsonformatter.curiousconcept.com