eouia / MMM-CalendarExt

Calendar views for MagicMirror
MIT License
55 stars 18 forks source link

ERROR! Could not validate main module js file. #20

Closed fering3 closed 5 years ago

fering3 commented 6 years ago

Getting the following error when loading MM. The calendars never load on electron (on the Pi), however when loading from an external browser, the calendars load without a problem. Could be an issue with the node version, but i have updated, and it had no effect.

/home/pi/.pm2/logs/mm-error-0.log last 15 lines:
0|mm       | ERROR! Could not validate main module js file.
0|mm       | /home/pi/MagicMirror/modules/MMM-CalendarExt/MMM-CalendarExt.js:182
0|mm       |   addCalendars: async function() {
0|mm       |                       ^^^^^^^^
0|mm       | SyntaxError: Unexpected token function
0|mm       |     at Object.exports.runInThisContext (vm.js:76:16)
0|mm       |     at Module._compile (module.js:528:28)
0|mm       |     at Object.Module._extensions..js (module.js:565:10)
0|mm       |     at Module.load (module.js:473:32)
0|mm       |     at tryModuleLoad (module.js:432:12)
0|mm       |     at Function.Module._load (module.js:424:3)
0|mm       |     at Module.require (module.js:483:17)
0|mm       |     at require (internal/module.js:20:19)
0|mm       |     at Class.loadModuleDefaultConfig (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:254:17)
0|mm       |     at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:211:10

similar discussion here.

eouia commented 6 years ago

I doubt MM has downgraded its node version of electron for some reason. Unfortunately, ‘async function’ is not working on the lower version of node. I think that is the reason for this issue. I’ll check and patch this for some time. Sorry, I should do my job first before this. Plz wait for a while.

eouia commented 6 years ago

I removed async from source. I hope this could be the solution.