deg0nz / MMM-PublicTransportBerlin

MagicMirror module to display public transport in Berlin and Brandenburg with BVG Hafas data.
MIT License
40 stars 20 forks source link

Cannot read properties of undefined #110

Closed OliverHi closed 1 year ago

OliverHi commented 1 year ago

Hi I am running this great module on my magic mirror but recently it stopped working spamming this error in the logs Error while fetching departures (for module Instance MY_STATION): TypeError: Cannot read properties of undefined (reading 'fetchDepartures') where I replaced my station name with MY_STATION.

Is this a known error? Otherwise please let me know how I can provide additional info if needed

KristjanESPERANTO commented 1 year ago

The module still works fine for me 🙂. Which MagicMirror version do you have? Are you using the latest version of the module? Please show us your configuration of the module.

OliverHi commented 1 year ago

I am running version v2.20.0 of MagicMirror currently. The problem started with d2b835d of this module and is still happening with the newest 2b71f13. Now with a different property, getStationName this time. My configuration was unchanged (from the former working version) and looks like this:

{
                        module: "MMM-PublicTransportBerlin",
                        position: "bottom_left",
                        config: {
                                name: "S Westend",
                                stationId: "900000026207",
                                travelTimeToStation: 5,
                                showColoredLineSymbols: true,
                                useBrightScheme: true
                        }
                },
KristjanESPERANTO commented 1 year ago

Interesting. Your configuration works for me with MagicMirror v2.20.0. What npm (npm -v) and node version (node -v) do you have?

Commit https://github.com/deg0nz/MMM-PublicTransportBerlin/commit/d2b835de634b0fe030d9dbfd13c099f35b138592 should not affect the functionality of the module at all, since stylelint is only used during development and not directly in the module.

OliverHi commented 1 year ago

I am using npm 7.21.1 and node v16.9.1 on a Pi zero using the Midori browser. The interesting part for me is that this exact setup worked some time ago. I just changed the address in the config from localhost to 0.0.0.0 to be able to check from my PC and ... well it worked there. I checked on the physical mirror too and now its working there (again) too. I am not sure if that is by chance or a result of this change

KristjanESPERANTO commented 1 year ago

Okay, nice that it's working again for now. Maybe there was a problem with the hafas endpoint.

Since I cannot reproduce the error myself, I recommend that you update node, npm and also MagicMirror and see if it occurs again.

rejas commented 1 year ago

Closing this issue, since it seems to be resolved