From c96a6b4d18bc6099c59599068cdec861d05f349c Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Mon, 12 Feb 2024 11:03:36 -0700 Subject: [PATCH 1/3] add error message if config.js appears empty after loading w require() in app.js --- js/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/app.js b/js/app.js index ec8f42f3dd..7cf3cd8da0 100644 --- a/js/app.js +++ b/js/app.js @@ -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) { From bc89433465b48166e3786188d5f66146eec56ad7 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Mon, 12 Feb 2024 11:14:27 -0700 Subject: [PATCH 2/3] fix formatting --- js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 7cf3cd8da0..77d0dc206f 100644 --- a/js/app.js +++ b/js/app.js @@ -115,8 +115,8 @@ 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?"); + 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); From 2615776ad4cc469bbdccc1258dc99dc83419a9ce Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Mon, 12 Feb 2024 15:30:48 -0700 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d8fb8dcc9..d14032a9d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ _This release is scheduled to be released on 2024-04-01._ - Ignore all custom css files (#3359) - [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361) - Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353) +- added message in case where config.js is missing the module.export line PR #3383 ### Deleted