• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

MMM-Wunderlist-Enhanced javascript error

Scheduled Pinned Locked Moved Troubleshooting
14 Posts 2 Posters 4.6k 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.
  • ? Offline
    A Former User
    last edited by Oct 9, 2017, 1:16 PM

    You can modify that with old style like this.

    (...)=>{...}
    

    to

    function (...) {...}
    
    1 Reply Last reply Reply Quote 0
    • ? Offline
      A Former User @geeklimit
      last edited by Oct 9, 2017, 1:17 PM

      @geeklimit I think pi zewo would use Midori instead Chromium as default browser. So you can try my above solution.

      1 Reply Last reply Reply Quote 0
      • ? Offline
        A Former User
        last edited by Oct 9, 2017, 1:19 PM

        Watchout! You should change all of this to self in function and prepend var self = this before function.

        1 Reply Last reply Reply Quote 0
        • G Offline
          geeklimit
          last edited by Oct 9, 2017, 1:20 PM

          I am using Midori as part of my startup script. Specifically:

          #!/bin/sh
          
          unclutter &
          xset -dpms # disable DPMS (Energy Star) features.
          xset s off # disable screen saver
          xset s noblank # don’t blank the video device
          matchbox-window-manager &
          midori -e Fullscreen -a http://localhost:8080
          
          ? 1 Reply Last reply Oct 9, 2017, 1:21 PM Reply Quote 0
          • ? Offline
            A Former User @geeklimit
            last edited by Oct 9, 2017, 1:21 PM

            @geeklimit can you change midori to chromium? I think its easier than code modifying.

            1 Reply Last reply Reply Quote 0
            • G Offline
              geeklimit
              last edited by Oct 9, 2017, 1:22 PM

              You’re losing me, but I think you mean I should edit the line causing the error from:

              this.config.lists.forEach((listValue, listKey) => {
              

              to

              this.config.lists.forEach ((listValue, listKey) {
              

              Or does this section of the code need a complete rewrite?

              ? 1 Reply Last reply Oct 9, 2017, 1:25 PM Reply Quote 0
              • ? Offline
                A Former User @geeklimit
                last edited by Oct 9, 2017, 1:25 PM

                @geeklimit sorry but i think there is not the only place where es6 style used. You should find and modify every place of that kinds. Browser changing is more easier.

                1 Reply Last reply Reply Quote 0
                • G Offline
                  geeklimit
                  last edited by geeklimit Oct 9, 2017, 2:14 PM Oct 9, 2017, 1:25 PM

                  I’d love to use Chromium instead of Midori, but the tutorial I followed for getting MagicMirror working on a Pi Zero W used Midori, and I don’t know a lot about what I’m doing.

                  Theoretically I could look up how to install Chromium and change the browser-boot script from:

                  #!/bin/sh
                  
                  unclutter &
                  xset -dpms # disable DPMS (Energy Star) features.
                  xset s off # disable screen saver
                  xset s noblank # don’t blank the video device
                  matchbox-window-manager &
                  midori -e Fullscreen -a http://localhost:8080
                  

                  to

                  #!/bin/sh
                  
                  unclutter &
                  xset -dpms # disable DPMS (Energy Star) features.
                  xset s off # disable screen saver
                  xset s noblank # don’t blank the video device
                  matchbox-window-manager &
                  chromium-browser --no-sandbox --app="http://localhost:8080"
                  

                  Assuming that Chromium uses the same switches?

                  Installing Chromium now via:

                  sudo apt-get -y install chromium-browser
                  

                  Will test.

                  1 Reply Last reply Reply Quote 0
                  • ? Offline
                    A Former User @geeklimit
                    last edited by A Former User Oct 9, 2017, 1:30 PM Oct 9, 2017, 1:29 PM

                      getTodos: function() {
                        var tasks = [];
                          var self = this;
                        this.config.lists.forEach( function (listValue, listKey) {
                          let list = self.tasks[listValue];
                          if (list && list.length)
                            list.forEach(function (todo)  {
                              if (self.config.order === 'reversed') {
                                tasks.push(todo);
                              } else {
                                tasks.unshift(todo)
                              }
                    

                    This ie rewritten code (not tested but I think it will work.)

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      geeklimit
                      last edited by Oct 9, 2017, 1:33 PM

                      Thanks! I am having other “SyntaxError: Unexpected token” errors in other modules as well, as you guessed.

                      Trying chromium first. I think that might be a better option, because even the default Compliments.js module has the same error.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        8/14
                        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