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.

    ReferenceError: fetch is not defined

    Scheduled Pinned Locked Moved Solved Troubleshooting
    6 Posts 2 Posters 407 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.
    • R Offline
      ReD1470
      last edited by

      Could not find anything helpfull on the web, of this forum so here goes.

      MM was running fine until latest update. Weather stopped working.,
      Fixed it by using the sample settings, they changed from openweather to openmeto. ok, no prob.

      But now, dont ask, calender and newsfeed keep loading.
      I tried;

      • git pull in Magic mirror folder
      • ran npm install node-fetch@2 in Magic mirror and calender module folder
      • ran sdetweil repair script (
      • updated Pi3, running bookwork

      the log shows this
      0|mm | [2024-10-18 14:59:19.435] [ERROR] Whoops! There was an uncaught exception…
      0|mm | [2024-10-18 14:59:19.448] [ERROR] ReferenceError: fetch is not defined
      0|mm | at fetchCalendar (/home/pi/MagicMirror/modules/default/calendar/calendarfetcher.js:51:3)
      0|mm | at CalendarFetcher.startFetch (/home/pi/MagicMirror/modules/default/calendar/calendarfetcher.js:96:3)
      0|mm | at Class.createFetcher (/home/pi/MagicMirror/modules/default/calendar/node_helper.js:79:11)
      0|mm | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/default/calendar/node_helper.js:15:9)
      0|mm | at Socket. (/home/pi/MagicMirror/js/node_helper.js:91:10)
      0|mm | at Socket.onevent (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:462:26)
      0|mm | at Socket._onpacket (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:430:22)
      0|mm | at /home/pi/MagicMirror/node_modules/socket.io/dist/client.js:214:24
      0|mm | at process.processTicksAndRejections (node:internal/process/task_queues:78:11)

      Strange, but have Hyper-v debian running with MM and no problem there

      Anyone?

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

        @ReD1470 what nodejs version are you running?

        node -v

        you need 20.9.0 or above, but not any v 21

        the npm install should fail on v 2.29.0 as it checks the version too

        my upgrade script is 2 part right?
        without any parameters its it just a test, no changes
        with a parameter it will DO the upgrade, nodejs too

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          ReD1470 @sdetweil
          last edited by

          @sdetweil

          Yes node -v
          v20.9.0

          Yes the install script was applied with apply
          bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/upgrade-script.sh)” apply

          If you want i can try and zip and post the upgrade.log

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

            @ReD1470 note… IF you tried to do it manually, my script will abort if you try to auto upgrade again…
            (I will not install updates over already updated)

            so you have to change apply to force, to FORCE the scrip to do it anyhow

            don’t need the whole upgrade log just the last 20 lines

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              ReD1470 @sdetweil
              last edited by

              @sdetweil

              WOW that did alot… i think
              but you sure now your stuf… problem fixed. I got my calender back
              TNX!

              here are the last lines of the log
              ----------------------------------
              npm WARN deprecated har-validator@5.1.5: this library is no longer supported
              npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
              npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

              added 48 packages, and audited 49 packages in 8s

              2 packages are looking for funding
              run npm fund for details

              2 moderate severity vulnerabilities

              Some issues need review, and may require choosing
              a different dependency.

              Run npm audit for details.

              processing complete for module MMM-SystemStats
              

              restoring custom.css
              removing git alias
              Upgrade ended - Sun Oct 20 17:53:11 CEST 2024

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

                @ReD1470 awesome. glad it’s working

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • R ReD1470 has marked this topic as solved on
                • 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