RCVolus / lol-pick-ban-ui

Web-Based UI to display the league of legends champ select in esports tournaments.
MIT License
241 stars 69 forks source link

UnhandledPromiseRejectionWarning while starting #9

Closed kodbilenadam closed 4 years ago

kodbilenadam commented 4 years ago
2020-05-19T19:21:56.428Z [info ] main        :   _          _       ____  ___   ____    _   _ ___
2020-05-19T19:21:56.429Z [info ] main        :  | |    ___ | |     |  _ \( _ ) | __ )  | | | |_ _|
2020-05-19T19:21:56.430Z [info ] main        :  | |   / _ \| |     | |_) / _ \/\  _ \  | | | || |
2020-05-19T19:21:56.430Z [info ] main        :  | |__| (_) | |___  |  __/ (_>  < |_) | | |_| || |
2020-05-19T19:21:56.431Z [info ] main        :  |_____\___/|_____| |_|   \___/\/____/   \___/|___|
2020-05-19T19:21:56.432Z [info ] main        :
2020-05-19T19:21:56.433Z [info ] main        : Configuration: {"data":"recordings/tournament-draft","leaguePath":""}
2020-05-19T19:21:56.434Z [info ] DataProviderService: Using recording as data provider service: recordings/tournament-draft
2020-05-19T19:21:56.434Z [warn ] DataProviderService: THIS IS PROBABLY MEANT FOR TESTING USAGE AND SHOULD ONLY BE USED IN PRODUCTION, IF YOU KNOW WHAT YOU ARE DOING!
2020-05-19T19:21:56.444Z [info ] datadragon  : Getting latest versions from ddragon.
2020-05-19T19:21:58.242Z [info ] datadragon  : Champion: 10.10.32161768608, Item: 10.10.32161768608, CDN: https://ddragon.leagueoflegends.com/cdn
(node:14216) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at DataDragon.init (D:\Projects\lol-pick-ban-ui\backend-build\data\league\datadragon.js:67:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async main (D:\Projects\lol-pick-ban-ui\backend-build\app.js:40:5)
(node:14216) 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: 1)
(node:14216) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I am getting this error while starting the application.

OS: Windows 10 Node Ver: v12.16.1

Laraakaa commented 4 years ago

Thank you for reporting! I was just looking into this, and the issue is something with the service where the tool gets the static data from (DataDragon).

It usually checks for the latest version on this endpoint: https://ddragon.leagueoflegends.com/realms/euw.json

Which returns "10.10.32161768608" for current version. This is unusual, usually it should be 10.10.1.

Then, it hits up https://ddragon.leagueoflegends.com/cdn/10.10.32161768608/data/en_US/champion.json to find out about available champion. Unfortunately, this doesn't work for the current patch.

For last patch, this works: https://ddragon.leagueoflegends.com/cdn/10.9.1/data/en_US/champion.json

So, the workaround is to open up config.json and set the contentPatch to 10.9.1.

Like I did here: https://github.com/RCVolus/lol-pick-ban-ui/blob/bbda0489f6d364a2d820818c57e129cb3fae976a/config.json#L20

Since there was no champion added or changed this patch (10.10), this should be fine.

ManuelHenao commented 4 years ago

i see the same, but i dont mencioned cuz was pretty strange.

woirking on 10.9.1

Laraakaa commented 4 years ago

Hey everyone, with the latest patch this got an update. Now it is working again as expected. I recommend to switch back in config.json to use the "latest" patch, instead of using a fixed number. Especially with Volibear now being available, and having updated art in the client, this is important so it gets updated.

https://github.com/RCVolus/lol-pick-ban-ui/commit/8bf6aefdeb53723abcb9a2f173b40c5e0b0aa5fc