Read the statement by Michael Teeuw here.
Compliments module has stopped working
-
@sdetweil thanks for your reply. Just to be clear you mean i should not edit the compliments.js file and any configs should be in the config.js file (Sorry probably a newbie question but im still learning)
The mm.sh code is listed below:
cd ./MagicMirror DISPLAY=:0 npm start
I hope this is what you are after.
-
@geekhouri the mm.sh should be
cd ~/MagicMirror~ means logged on users home folder
config.js, yes
{ module:"compliments", position:"....." config:{ compliments: your compliments config {.. } } }
the system design is
whatever is in config.js, overrides/replaces what is defined in the module defaults section -
@sdetweil thanks for your feedback, i have updated my config.js file but now i run into the config file error and MM does not load. Code is below as is the error after running config: check
{ module: "compliments", position: "top_bar" config: { compliments: { anytime: ["Be Smart, Be Kind, Be Like Jesus!"], morning: ["Good morning!", "Enjoy your day!", "How was school"], afternoon: ["How was School?", "Finish Your homework?"], evening: ["Sweet Dreams", "You look nice!", "Ready for School"], "....-01-12": ["Happy new year!"] "....02-12": ["Happy Birthday E!"] "....03-12": ["Happy Birthday Z!"] "....05-12": ["Happy Birthday G!"] } },
npm run config:check
[24.01.2024 01:07.25.065] [INFO] Checking file... /home/gkhouri/MagicMirror/config/config.js [24.01.2024 01:07.25.165] [ERROR] Your configuration file contains syntax errors :( [24.01.2024 01:07.25.167] [ERROR] Line 68 column 4: Parsing error: Unexpected token config
Line 68 is config: { …
Thanks again
-
@geekhouri said in Compliments module has stopped working:
Line 68 column 4: Parsing error: Unexpected token config
yes, 99% of the time that means the line before was missing a trailing comma (which means more lines coming for this item)
your last 4 lines of the compliments list do not have the trailing comma
and the position linejust because I didn’t include it my text above doesn’t mean it’s not required…
-
@sdetweil made those changes and MM is working again however i the compliments are still not visible? Any thoughts?
-
@geekhouri also missing a close } before the last one
{ module: "compliments", position: "top_bar", config: { compliments: { anytime: ["Be Smart, Be Kind, Be Like Jesus!"], morning: ["Good morning!", "Enjoy your day!", "How was school"], afternoon: ["How was School?", "Finish Your homework?"], evening: ["Sweet Dreams", "You look nice!", "Ready for School"], "....-01-12": ["Happy new year!"], "....02-12": ["Happy Birthday E!"], "....03-12": ["Happy Birthday Z!"], "....05-12": ["Happy Birthday G!"], } // end of compliments } // end of config } // end of module
you should see the error where you start mm…
if using pm2, then
pm2 logs --lines=50
-
@sdetweil still nothing, here is my code in full and the pm2 logs:
{ module: "compliments", position: "top_bar", config: { compliments: { anytime: ["Be Smart, Be Kind, Be Like Jesus!"], morning: ["Good morning!", "Enjoy your day!", "How was school"], afternoon: ["How was School?", "Finish Your homework?"], evening: ["Sweet Dreams", "You look nice!", "Ready for School"], "....-01-12": ["Happy new year!"], "....02-12": ["Happy Birthday E!"], "....03-12": ["Happy Birthday Z!"], "....05-12": ["Happy Birthday G!"], } //end of compliments } //end of config }, //end of module
Pm2 logs as follows:
0|mm | at Object..js (node:internal/modules/cjs/loader:1326:10) 0|mm | at Module.load (node:internal/modules/cjs/loader:1126:32) 0|mm | at node:internal/modules/cjs/loader:967:12 0|mm | Warning: vkCreateInstance: Found no drivers! 0|mm | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER 0|mm | at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v ulkan/VulkanError.cpp:88) 0|mm | at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul kan/BackendVk.cpp:458) 0|mm | at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:344) 0|mm | at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen dVk.cpp:266) 0|mm | at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:521) 0|mm | 0|mm | /home/gkhouri/MagicMirror/node_modules/electron/dist/electron exite d with signal SIGINT 0|mm | [24.01.2024 01:29.00.569] [ERROR] WARNING! Could not validate confi g file. Starting with default configuration. Please correct syntax errors at or above this line: /home/gkhouri/MagicMirror/config/config.js:68 0|mm | config: { 0|mm | ^^^^^^ 0|mm | 0|mm | SyntaxError: Unexpected identifier 'config' 0|mm | at internalCompileFunction (node:internal/vm:73:18) 0|mm | at wrapSafe (node:internal/modules/cjs/loader:1185:20) 0|mm | at Module._compile (node:internal/modules/cjs/loader:1227:27) 0|mm | at Object..js (node:internal/modules/cjs/loader:1326:10) 0|mm | at Module.load (node:internal/modules/cjs/loader:1126:32) 0|mm | at node:internal/modules/cjs/loader:967:12 0|mm | at Function._load (node:electron/js2c/asar_bundle:2:13327) 0|mm | at Module.require (node:internal/modules/cjs/loader:1150:19) 0|mm | at require (node:internal/modules/cjs/helpers:121:18) 0|mm | at loadConfig (/home/gkhouri/MagicMirror/js/app.js:118:14) 0|mm | at App.start (/home/gkhouri/MagicMirror/js/app.js:248:18) 0|mm | at Object.<anonymous> (/home/gkhouri/MagicMirror/js/electron.js :192:7) 0|mm | at Module._compile (node:internal/modules/cjs/loader:1271:14) 0|mm | at Object..js (node:internal/modules/cjs/loader:1326:10) 0|mm | at Module.load (node:internal/modules/cjs/loader:1126:32) 0|mm | at node:internal/modules/cjs/loader:967:12 0|mm | Warning: vkCreateInstance: Found no drivers! 0|mm | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER 0|mm | at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v ulkan/VulkanError.cpp:88) 0|mm | at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul kan/BackendVk.cpp:458) 0|mm | at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:344) 0|mm | at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen dVk.cpp:266) 0|mm | at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:521) 0|mm | 0|mm | /home/gkhouri/MagicMirror/node_modules/electron/dist/electron exite d with signal SIGINT 0|mm | Warning: vkCreateInstance: Found no drivers! 0|mm | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER 0|mm | at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v ulkan/VulkanError.cpp:88) 0|mm | at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul kan/BackendVk.cpp:458) 0|mm | at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:344) 0|mm | at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen dVk.cpp:266) 0|mm | at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:521) 0|mm |
-
@geekhouri said in Compliments module has stopped working:
0|mm | [24.01.2024 01:29.00.569] [ERROR] WARNING! Could not validate confi g file. Starting with default configuration. Please correct syntax errors at or above this line: /home/gkhouri/MagicMirror/config/config.js:68
0|mm | config: {
0|mm | ^^^^^^
0|mm |
0|mm | SyntaxError: Unexpected identifier ‘config’I can only assume you haven’t saved the updated config… (I do that sometimes…oops)
-
@sdetweil thanks again. Saved the file, flushed the logs rebooted and new log is below no new errrors and i think you previously stated the errors below cant be hidden. . Still no Compliments working (i’m at a loss now)
0|mm | Warning: vkCreateInstance: Found no drivers! 0|mm | Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER 0|mm | at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/v ulkan/VulkanError.cpp:88) 0|mm | at CreateVkInstance (../../third_party/dawn/src/dawn/native/vul kan/BackendVk.cpp:458) 0|mm | at Initialize (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:344) 0|mm | at Create (../../third_party/dawn/src/dawn/native/vulkan/Backen dVk.cpp:266) 0|mm | at operator() (../../third_party/dawn/src/dawn/native/vulkan/Ba ckendVk.cpp:521) 0|mm |
-
@geekhouri ok, lets stop using pm2…
pm2 stop all
then
cd ~/MagicMirror
npm startwait
if you are doing this on the MM screen
ctrl-q to stop mm (with pm2, it would restart it immediately… thats is job)so, see anything in the output??
I used your config and it worked (on v2.26) without any issues