Cannot read properties of undefined (reading 'modules')
See original GitHub issueOS
Pi4 4GB
NodeJS Version
16.13.1
MagicMirror Version
2.16.0
Remote Control Version
2.3.6
Did you try using just Remote Control alone with MM?
- I have and the error still happening
Description
Can’t restart over the Remote Control
Expected behavior
restart MagicMirror
Current behavior
nothing
Possible solution
No response
Steps to reproduce
Click restart nothing happend
Log
Wed, 19 Jan 2022 08:19:12 GMT express deprecated res.send(status): Use res.sendStatus(status) instead at modules/MMM-Remote-Control/node_helper.js:138:25
0|MagicMir | [19.01.2022 09:27.33.424] [ERROR] TypeError: Cannot read properties of undefined (reading 'modules')
0|MagicMir | at Class.answerConfigHelp (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:342:52)
0|MagicMir | at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:161:22
0|MagicMir | at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|MagicMir | at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:137:13)
0|MagicMir | at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:112:3)
0|MagicMir | at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|MagicMir | at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:281:22
0|MagicMir | at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:341:12)
0|MagicMir | at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:275:10)
0|MagicMir | at internalNext (/home/pi/MagicMirror/node_modules/helmet/dist/index.js:142:6)
0|MagicMir | [20.01.2022 09:19.12.869] [ERROR] Whoops! There was an uncaught exception...
0|MagicMir | [20.01.2022 09:19.12.884] [ERROR] TypeError: Cannot read properties of undefined (reading 'modules')
0|MagicMir | at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:223:60
0|MagicMir | at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
config.js
/*************** AUTO GENERATED BY REMOTE CONTROL MODULE ***************/
var config =
{
address: '0.0.0.0',
electronOptions: {
fullscreen: true,
width: 3840,
x: 1920
},
ipWhitelist: [],
language: 'de',
modules: [
{
module: 'alert',
config: {}
},
{
module: 'clock',
position: 'top_left',
config: {}
},
{
module: 'calendar',
position: 'top_left',
header: 'Termine',
config: {
calendars: [
{
symbol: 'calendar-check',
url: 'xxxx'
}
],
maximumEntries: 5
}
},
{
module: 'calendar',
header: 'Geburtstage',
position: 'top_left',
config: {
calendars: [
{
symbol: 'birthday-cake',
url: 'xxx',
maximumEntries: '2'
}
]
}
},
{
module: 'compliments',
position: 'top_center',
config: {
compliments: {
anytime: [
'Na du!'
],
morning: [
'Guten morgen',
'Genies deinen Tag!'
],
afternoon: [
'Du siehst gut aus!'
],
evening: [
'Bettzeit',
'Schlaf gut',
'Ab ins Bett'
],
'....-01-01': [
'Happy new year!'
]
}
},
header: ''
},
{
module: 'weather',
position: 'top_right',
config: {
location: 'xxx',
locationID: 'xx',
apiKey: 'xxx',
iconTable: {
'01d': 'wi-day-sunny',
'02d': 'wi-day-cloudy',
'03d': 'wi-cloudy',
'04d': 'wi-cloudy-windy',
'09d': 'wi-showers',
'10d': 'wi-rain',
'11d': 'wi-thunderstorm',
'13d': 'wi-snow',
'50d': 'wi-fog',
'01n': 'wi-night-clear',
'02n': 'wi-night-cloudy',
'03n': 'wi-night-cloudy',
'04n': 'wi-night-cloudy',
'09n': 'wi-night-showers',
'10n': 'wi-night-rain',
'11n': 'wi-night-thunderstorm',
'13n': 'wi-night-snow',
'50n': 'wi-night-alt-cloudy-windy'
}
}
},
{
module: 'weather',
position: 'top_right',
header: 'Wettervorhersage',
config: {
type: 'forecast',
location: 'xxx',
locationID: 'xxx',
apiKey: 'xxx'
}
},
{
module: 'newsfeed',
position: 'bottom_bar',
config: {
feeds: [
{
title: 'Tagesschau',
url: 'https://www.tagesschau.de/xml/rss2/'
}
]
}
},
{
module: 'MMM-Remote-Control',
header: '',
config: {
apiKey: 'xxx',
pm2ProcessName: 'MagicMirror'
}
},
{
module: 'MMM-iHaveBeenThere',
position: 'fullscreen_below',
header: '',
config: {
success: true,
query: {
data: 'defaultConfig',
module: 'MMM-iHaveBeenThere'
},
data: {
title: '',
AnimationEnabled: true,
pauseDuration: 3,
animationDuration: 10,
displayDesc: false,
zoomLevel: 1.5,
zoomLongitude: -20,
zoomLatitude: 60,
home_lat: 51.xxxx,
home_lon: 7.xxxx,
home_desc: 'xxx',
away_lat: [
25.xxx,
21.xx,
40.xx,
41.xx,
'52.xxx',
'48.xxx',
'-22.xxx'
],
away_lon: [
-80.xxx,
-86.xxx,
9.xx,
2.xx,
'13.xxx',
'11.xxx',
'17.xxx'
],
away_desc: [
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxxx'
],
trip: [
false,
false,
false,
false
],
colorCountries: '#BDBDBD',
colorCountryBorders: '#000000',
colorTargetPoints: '#FFFFFF',
colorPlane: '#FF0000',
colorPlaneLine: '#FFFFFF',
colorLegendBorder: '#FFFFFF',
colorLegendFont: '#FFFFFF',
colorTitleFont: '#FFFFFF'
},
title: '',
home_lat: 51.xxx,
home_lon: 7.xxxx,
away_desc: [
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxx'
],
displayDesc: false,
away_lat: [
25.xxx,
21.xx,
40.xx,
41.xx,
'52.xxx',
'48.xxx',
'-22.xxx'
],
away_lon: [
-80.xx,
-86.xx,
9.xx,
2.xx,
'13.xx',
'11.xx',
'17.xx'
],
home_desc: 'xxxxx',
trip: [
false,
false,
false,
false
],
zoomLevel: 1.5,
zoomLatitude: 30,
zoomLongitude: -50
}
},
{
module: 'MMM-MyGarbage',
position: 'top_left',
header: '',
config: {
success: true,
query: {
data: 'defaultConfig',
module: 'MMM-MyGarbage'
},
data: {
alert: false,
weeksToDisplay: 3,
limitTo: 99,
dateFormat: 'dddd D MMMM',
fade: true,
fadePoint: 0.25
}
}
}
],
useHttps: false,
httpsPrivateKey: '',
httpsCertificate: '',
locale: 'en-US'
}
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}
Additional info
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:13
Top Results From Across the Web
Cannot read properties of undefined (reading 'modules') #7220
The error message here is referring to useSSRContext().modules It seems that useSSRContext is returning null for some reason, possibly because ...
Read more >javascript - TypeError: Cannot read properties of undefined ...
You are trying to iterate through the args array ( args.forEach() ) before var args exists. If you move var args = Message.content.split(" ......
Read more >Uncaught TypeError Cannot read properties of undefined ...
Have you received Uncaught TypeError Cannot read properties of undefined reading Modules JavaScript client error on the page or in the browser console?...
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This error doesn’t seem to be the same as the one before. It’s probably some compatibility with modules. Did you try to take everything of except from RC? I don’t see any
config.js
either, so I can’t replicate this error.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.