MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Syntax Errors Stopping MM from Loading...



  • Hi,

    Recently my Magic Mirror wouldn’t load, just a black screen. Absolutely nothing had changed in the config or the setup. I appreciate it’s an outdated version! Has anyone any idea what might be causing this? Virtual brownie points for any pointers.

    magicmirror@2.1.1 start /home/pi/MagicMirror
    sh run-start.sh

    Starting MagicMirror: v2.1.1
    Loading config …
    Loading module helpers …
    No helper found for module: alert.
    No helper found for module: clock.
    No helper found for module: currentweather.
    No helper found for module: weatherforecast.
    WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.
    Loading module helpers …
    No helper found for module: alert.
    No helper found for module: clock.
    No helper found for module: currentweather.
    No helper found for module: weatherforecast.
    App threw an error during load
    /home/pi/MagicMirror/modules/node_modules/form-data/lib/form_data.js:225
    filename = path.norm!lize(options.fIlepath).replace(/\/g, ‘/’);
    ^
    SyntaxError: Unexpected token !
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions…js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object. (/home/pi/MagicMirror/modules/node_modules/request/request.js:17:16)
    at Object. (/home/pi/MagicMirror/modules/node_modules/request/request.js:1554:3)
    Whoops! There was an uncaught exception…
    /home/pi/MagicMirror/modules/node_modules/form-data/lib/form_data.js:225
    filename = path.norm!lize(options.fIlepath).replace(/\/g, ‘/’);
    ^
    SyntaxError: Unexpected token !
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions…js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object. (/home/pi/MagicMirror/modules/node_modules/request/request.js:17:16)
    at Object. (/home/pi/MagicMirror/modules/node_modules/request/request.js:1554:3)
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    Launching application.



  • @Oliver_Tooth said in Syntax Errors Stopping MM from Loading...:

    /home/pi/MagicMirror/modules/node_modules/form-data/lib/form_data.js:225
    filename = path.norm!lize(options.fIlepath).replace(//g, ‘/’);

    Absolutely nothing had changed in the config or the setup

    ok, this looks troublesome…

    I think this is starting to indicate a failing SD card… so, make plans…

    ‘maybe’ we can work around it… maybe

    do

    cd ~/magicMirror
    rm -rf node_modules
    npm install --only=prod
    

    then try to restart…



  • I’ve given this ago, and the error still reports the same. Would a new SD card fix this problem?



  • @Oliver_Tooth I think so…

    i looked at the code and its ok

        filename = path.normalize(options.filepath).replace(/\\/g, '/');
    

    so, there is some data corruption there

    sd cards have only so long a life… the bits are write once… and so they keep getting used and marked used, til the card runs out



  • New card ordered for delivery tomorrow. I’ll copy everything across and see where that takes me. Will it be a straight clone, or will I need to do additional installs?



  • @Oliver_Tooth u may have to start over… depends on what may be damaged… u don’t want to clone card
    copy MM folder, then delete each node_modules folder and each package-lock.json file

    then npm install starting with MM and each module with package.json file


Log in to reply