MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Syntax Errors Stopping MM from Loading...

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    6 Posts 2 Posters 768 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O Offline
      Oliver_Tooth
      last edited by

      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.

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @Oliver_Tooth
        last edited by

        @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…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • O Offline
          Oliver_Tooth
          last edited by

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

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @Oliver_Tooth
            last edited by

            @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

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • O Offline
              Oliver_Tooth
              last edited by

              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?

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @Oliver_Tooth
                last edited by sdetweil

                @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

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy