Elaniobro / MMM-nyc-transit

MTA transit module for Magic Mirror
MIT License
21 stars 14 forks source link

[🐛 BUG] - UnhandledPromiseRejectionWarning: Error: RangeError: index out of range: 3 + 109 > 23 (RESOLVED - API KEY WAS EXPIRED) #82

Closed wezmininger closed 2 years ago

wezmininger commented 2 years ago

(RESOLVED - MTA API KEY HAD EXPIRED! CHECK YOUR KEY!)

Describe the bug NYC transit module keeps showing this error and never works, when quitting MM, the errors at the bottom appear

I see this bug was open in the past and closed but there doesnt appear to be an actual fix yet

To Reproduce add MMM-nyc-transit module to the Magic mirror modules folder and install with npm install made sure to git pull the latest version of this module install with npm install

Expected behavior Next Train should show the trains

Actual behavior Next Train appears with no other data when magicmirror is running

Platform (please complete the following information):

Configuration { module: "MMM-nyc-transit", position: "bottom_left", header: "Next Train", config: { apiKey: "DELETED", mtaType: "train", displayType: "list", stations: [130,93], stations: [ { stationId: 130, walkingTime: 8, dir: { upTown: false, downTown: true } }, { stationId: 177, walkingTime: 8, dir: { upTown: true, downTown: false } } ], updateInterval: 10000 } },

Additional context have tried on bullseye 64big and 32bith on both Pi 3B+ and Pi 4 with the same results

ERRORS HERE

[18.03.2022 18:10.34.018] [ERROR] (node:1763062) UnhandledPromiseRejectionWarning: Error: RangeError: index out of range: 3 + 109 > 23 at /home/pi/MagicMirror/modules/MMM-nyc-transit/node_helper.js:187:15 at processTicksAndRejections (node:internal/process/task_queues:96:5) (Use electron --trace-warnings ... to show where the warning was created) [18.03.2022 18:10.34.020] [ERROR] (node:1763062) 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) [18.03.2022 18:10.34.048] [INFO] Checking git for module: MMM-nyc-transit

[18.03.2022 18:10.43.070] [ERROR] (node:1763062) UnhandledPromiseRejectionWarning: Error: RangeError: index out of range: 3 + 109 > 23 at /home/pi/MagicMirror/modules/MMM-nyc-transit/node_helper.js:187:15 at processTicksAndRejections (node:internal/process/task_queues:96:5) [18.03.2022 18:10.43.137] [ERROR] (node:1763062) 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: 2) [18.03.2022 18:10.47.954] [ERROR] (node:1763062) UnhandledPromiseRejectionWarning: Error: RangeError: index out of range: 3 + 109 > 23 at /home/pi/MagicMirror/modules/MMM-nyc-transit/node_helper.js:187:15 at processTicksAndRejections (node:internal/process/task_queues:96:5) [18.03.2022 18:10.47.961] [ERROR] (node:1763062) 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: 3) [18.03.2022 18:10.57.981] [ERROR] (node:1763062) UnhandledPromiseRejectionWarning: Error: RangeError: index out of range: 3 + 109 > 23 at /home/pi/MagicMirror/modules/MMM-nyc-transit/node_helper.js:187:15 at processTicksAndRejections (node:internal/process/task_queues:96:5)

Elaniobro commented 2 years ago

Is your error for all station ID's? Can you try one at a time, in one direction and see if that works?

wezmininger commented 2 years ago

My MTA API Key had expired without my knowing, so when I pasted it in, never worked. After renewing/creating another it works now