jalibu / MMM-NINA

Eine simple Client Implementierung der NINA Warn App API für die MagicMirror² Plattform.
MIT License
21 stars 8 forks source link

Unhandled promise rejection #23

Open Gorkrul opened 3 hours ago

Gorkrul commented 3 hours ago

Platform

bastilimbach/docker-MagicMirror

Node.js Version

v12.22.1

MagicMirror Version

2.15.0

Module Version

commit 791dc8a212cbedd1738af87d6e709ea5217854a0

Description

[ERROR] (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Expected behavior

-?- no error ^^

Current behavior

-?-

Possible solution

No response

Steps to reproduce

just run mm2 and see the logs

Log

[ERROR] (node:1) UnhandledPromiseRejectionWarning: ReferenceError: fetch is not defined
    at /opt/magic_mirror/modules/MMM-NINA/node_helper.js:14:362229
    at Array.map (<anonymous>)
    at Class.<anonymous> (/opt/magic_mirror/modules/MMM-NINA/node_helper.js:14:362146)
    at /opt/magic_mirror/modules/MMM-NINA/node_helper.js:14:622
    at new Promise (<anonymous>)
    at i (/opt/magic_mirror/modules/MMM-NINA/node_helper.js:14:367)
    at Class.socketNotificationReceived (/opt/magic_mirror/modules/MMM-NINA/node_helper.js:14:362026)
    at Socket.<anonymous> (/opt/magic_mirror/js/node_helper.js:109:11)
    at Socket.emit (events.js:314:20)

config.js

{
     module: "MMM-NINA",
     position: "right_bottom",
     config: {
         ags: ["051120000000", "051700024024", "051580028028", "051110000000"], // Liste der Gemeinden, die abgefragt werden sollen
         // Duisburg, Moers, Ratingen, Düsseldorf
         downgradeLhpSeverity: false,
         downgradeCancelSeverity: true,
         hideCancelledWarnings: false,
         excludeProviders: [], // Mögliche Werte ["MOWAS", "DWD", "BIWAPP", "LHP"]
         maxAgeInHours: 6,
         maxWidth: "200px",
         mergeAlertsById: true,
         mergeAlertsByTitle: true,
         orderBySeverity: true,
         showIcon: true,
         showDate: true,
         showCity: true,
         showNoWarning: true,
         theme: "top", // Erlaubte Werte: top, top-floating, side
         updateIntervalInSeconds: 120,

     }
 },

Additional info

none

KristjanESPERANTO commented 2 hours ago

ReferenceError: fetch is not defined

You are using node version 12. This reached end of life over 2 years ago and doesn't support fetch.

You have to update node.