Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'on') #2793

Closed
1BlauNitrox opened this issue Jan 22, 2022 · 4 comments
Closed

TypeError: Cannot read properties of undefined (reading 'on') #2793

1BlauNitrox opened this issue Jan 22, 2022 · 4 comments
Labels

Comments

@1BlauNitrox
Copy link

1BlauNitrox commented Jan 22, 2022

Yesterday my mirror works without any issues. Today in the morning I started the software and following error occures:

[22.01.2022 11:07.08.678] [ERROR] Whoops! There was an uncaught exception...
[22.01.2022 11:07.08.680] [ERROR] TypeError: Cannot read properties of undefined (reading 'on')
    at Object.<anonymous> (/home/pi/MagicMirror/js/electron.js:104:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

The mirror is on the lastest version, because I downloaded the software yesterday.
The Modules I have installed are:

  • Spotify
  • Calendar_monthly
  • some default modules like weather or clock
  • an own module to display my substitution plan from school

My config.js looks like this:

let config = {
	address: "localhost", 	// Address to listen on, can be:
							// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
							// - another specific IPv4/6 to listen on a specific interface
							// - "0.0.0.0", "::" to listen on any interface
							// Default, when address config is left out or empty, is "localhost"
	port: 8080,
	basePath: "/", 	// The URL path where MagicMirror is hosted. If you are using a Reverse proxy
					// you must set the sub path here. basePath must end with a /
	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], 	// Set [] to allow all IP addresses
															// or add a specific IPv4 of 192.168.1.5 :
															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
															// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

	useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
	httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
	httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true

	language: "de",
	locale: "de-DE",
	logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
	timeFormat: 24,
	units: "metric",
	// serverOnly:  true/false/"local" ,
	// local for armv6l processors, default
	//   starts serveronly and then starts chrome browser
	// false, default for all NON-armv6l devices
	// true, force serveronly mode, because you want to.. no UI on this device

	modules: [
		{
			module: "alert",
		},
		{
			module: "clock",
			position: "top_left"
		},
		{
			module: "calendar_monthly",
			position: "top_left",
		},
		{
			module: "weather",
			position: "top_right",
			config: {
				weatherProvider: "openweathermap",
				type: "current",
				location: "myCity",
				locationID: "myCityID", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
				apiKey: "myAPIKey"
			}
		},
		{
			module: "weather",
			position: "top_right",
			header: "Wettervorhersage",
			config: {
				weatherProvider: "openweathermap",
				type: "forecast",
				location: "myCity",
				locationID: "myCityID", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
				apiKey: "myAPIKey"
			}
		},
		{
            		 module: "MMM-NowPlayingOnSpotify",
 			 position: "bottom_left",
			 config: {
				 showCoverArt: true,
   				 clientID: "myId",
    				 clientSecret: "mySecret",
    				 accessToken: "myToken",
    				 refreshToken: "myToken"
 			 }
		},
		{
			module: "MMM-VPlan",
			position: "bottom_right",
			config: {
				username: "myUsername",
				password: "myPassword"
			}
		},
	]
};

The issues occurred not for the first time. Some days ago I had the same issues and decited to delete and install the MagicMirror software again. After this the mirror runs perfectly. Today in the morning I change one line of code in my module: if(this.response.lenght <= 0) { to if(this.response.length <= 0) {
Than I deleted the old module from modules folder and copyed the new one. Now my mirror doesn`t start because of the error.

I already wrote a forum post: https://forum.magicmirror.builders/topic/16233/error-while-starting-magic-mirror/22

@rejas
Copy link
Collaborator

rejas commented Jan 22, 2022

have you tried disabling your 3d party modules to see if the error goes away?

@1BlauNitrox
Copy link
Author

already tried. Error stays. I have deleted and installed the software again. Now it works but I think I will see this error soon again

@jimbo95-beep
Copy link

jimbo95-beep commented Jan 22, 2022 via email

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants