mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 05:07:05 +00:00
add error message if config.js appears empty after loading w require() in app.js (#3383)
from forum, https://forum.magicmirror.builders/topic/18493/node_helper-js-is-not-working user created own config.js, did not copy the module exports line.. this caused the js/defaults.js list of modules to be processed for node_helpers but the physical config.js to be loaded for the web page (hard coded in index.html) so user modules needing node_helper didn't have that .. this adds a warning message in npm start output to help user resolve.. took two days to debug without message
This commit is contained in:
@@ -115,6 +115,9 @@ function App () {
|
||||
try {
|
||||
fs.accessSync(configFilename, fs.F_OK);
|
||||
const c = require(configFilename);
|
||||
if (Object.keys(c).length === 0) {
|
||||
Log.error("WARNING! Config file appears empty, maybe missing module.exports last line?");
|
||||
}
|
||||
checkDeprecatedOptions(c);
|
||||
return Object.assign(defaults, c);
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user