Pigpog / vlc-discord-rpc

Discord rich presence for VLC media player.
MIT License
207 stars 30 forks source link

UnhandledPromiseRejectionWarming when opening start.bat #75

Open Mustachy opened 2 years ago

Mustachy commented 2 years ago

I got an error "(node:4196) UnhandledPromiseRejectionWarming: SyntaxError: Unexpected token < in JSON at position 0" and Discord does not showing "Playing VLC Media Player"

It happens when I opened the script start.bat

(node:4196) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () at new VLCStatus (F:\Torrent\vlc-discord-rpc\node_modules\vlc.js\lib\src\http\classes\VLCStatus.js:13:27) at F:\Torrent\vlc-discord-rpc\node_modules\vlc.js\lib\src\http\Requester.js:65:21 at processTicksAndRejections (internal/process/task_queues.js:95:5) (node:4196) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 81)

Pigpog commented 2 years ago

Duplicate of issue #73

You have an HTTP server running on port 8080, which is the port that we need to access VLC on. If you intend on using attached mode, change the port number in config/config.js to any port >1024 thats not already in use (ie. 9090) If you want to use detached mode, the easiest solution is to reconfigure the http server that's using 8080 to use another port.