MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

MMM-GoogleMapsTraffic freezes Magic Mirror



  • For a long time a had the issue that MagicMirror freezes after a couple of hours. Finally I found out that after disabling the module GoogleMapsTrafic the error won’t occur.

    In the console the module produces 2 errors:

    js?key=xxxxxxxxxx:121 You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
    sh @ js?key= xxxxxxxxxx:121
    Ah @ js?key= xxxxxxxxxx:119
    google.maps.Load @ js?key= xxxxxxxxxx:18
    (anonymous) @ js?key= xxxxxxxxxx:208
    (anonymous) @ js?key= xxxxxxxxxx:208
    
    MMM-GoogleMapsTraffic.js:77 Uncaught TypeError: Cannot read property 'length' of undefined
        at HTMLScriptElement.script.onload (MMM-GoogleMapsTraffic.js:77)
    script.onload @ MMM-GoogleMapsTraffic.js:77
    

    My config is quite simple and I couldn’t find a way to avoid these errors.

    {
            	module: 'MMM-GoogleMapsTraffic',
    	      	position: 'center',
            	config: {
                    	key: 'xxxxxxxxxx',
                    	lat: 52.5202362,
                    	lng: 13.3663832,
                    	height: '800px',
                    	width: '780px',
    			zoom: 12,
    			updateInterval: 300000, //5 Minuten
    			styledMapType: 'standard',
                    	disableDefaultUI: true,
    			}
    },
    

    Does anybody experiences this problem?
    Every help is highly appreciated.



  • @macmirror yep I too have the problem of the mirror crashing on me with this module I have no idea how to fix it either.



  • I suspected this module for a while already but I never bothered to get into it. Whenever somebody reported random crashes after some hours they used the MMM-GoogleMapsTraffic module. In my case it is enough to run a cronjob once a day to reload the mirror.



  • I have te same probleem with the error MMM-GoogleMapsTraffic.js:77 Uncaught TypeError: Cannot read property ‘length’ of undefined.

    Do some one now what that means



  • I have the same issue. When I boot up the Magic Mirror in debug mode npm start dev & but the Chrome console tab tells me this nasty thing:

    "You have included the Google Maps JavaScript API multiple times on this page." 
    "This may cause unexpected errors."
    

    However, everything looks perfectly nice on my MagicMirror.
    All modules are successfully loaded, including “MMM-GoogleMapsTraffic”.

    But on the next day, the latest my screen is entirely black.
    It’s exactly the same thing as reported in this thread.



  • @drfukc it appears the api had trouble, and the module did not handle the error



  • @sdetweil
    yes, that’s the case, the module is running fine until it turns the monitor black (after several hours).
    There are more people in different threads having the same issue.
    The module author does not seem to respond.
    My workaround is a regular cron job restarting the MagicMirror.



  • @drfukc I am away til later today. I will look at it. One of my modules gets photos from google



  • Yep same I use cron job but would rather not have too, also this might be where all my ram goes as well, great if someone can look at this module



  • anybody want to try my updates

    1. load script once, once dom created
    2. improve process , handle lost config error

    https://github.com/sdetweil/MMM-GoogleMapsTraffic

    rename your existing folder out of the way
    then, from MM/modules folder, git clone my repo, and restart MM
    no changes to module config


Log in to reply