Skip to content

Nach Update auf 5.2.11 Fehler in setTimeout() #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ticaki opened this issue Sep 12, 2021 · 12 comments · Fixed by #882
Closed

Nach Update auf 5.2.11 Fehler in setTimeout() #881

ticaki opened this issue Sep 12, 2021 · 12 comments · Fixed by #882

Comments

@ticaki
Copy link

ticaki commented Sep 12, 2021

Nach Update auf 5.2.11 werden setTimeout() und clearTimeout() als unbekannt angezeigt. Werfen auch entsprechende Fehler aus.

Wobei ich dieses Update ca. 5 mal durchgeführt habe weil er auf .10 stehen geblieben ist.

@Apollon77
Copy link
Contributor

bitte log zeigen

@Apollon77
Copy link
Contributor

which version you had before?

@ticaki
Copy link
Author

ticaki commented Sep 12, 2021

vorher hatte ich 5.2.10

Skriptcode:

        if (j[a].sleep === undefined) return;
        if (j[a].wake==0) {
            j[a].wake=new Date();
            if (timeout) clearTimeout(timeout);
            timeout = setTimeout(function(){
                sendTelegram(j[a], j);
            },5*60*1000);
        }

log:

2021-09-12 11:37:04.951 - error: javascript.0 (1627) Error in callback: TypeError: Cannot read property 'sleep' of undefined
2021-09-12 11:37:04.952 - error: javascript.0 (1627) at sendTelegram (script.js.common.Schlafenszeit_&Nachmodus:60:96)
2021-09-12 11:37:04.952 - error: javascript.0 (1627) at Object. (script.js.common.Schlafenszeit
&_Nachmodus:36:21)
2021-09-12 11:37:04.952 - error: javascript.0 (1627) at Timeout._onTimeout (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2119:34)
2021-09-12 11:37:04.953 - error: javascript.0 (1627) at listOnTimeout (internal/timers.js:554:17)
2021-09-12 11:37:04.953 - error: javascript.0 (1627) at processTimers (internal/timers.js:497:7)

@Apollon77
Copy link
Contributor

Liess mal die Fehler meldung richg!!

TypeError: Cannot read property 'sleep' of undefined

Das musst du fixen. der Timeout und sowas tut

j[a] is undefined und daher wirt der zugriff auf j[a].sleep einen fehler

@ticaki
Copy link
Author

ticaki commented Sep 12, 2021

Möglich, das Skript läuft schon seit rund 1,5 Jahren ohne Probleme und beim überprüfen mit .11 wurde mir clearTimeout und setTimeout als Fehler mit Grund (unbekannt) angezeigt.

@Apollon77
Copy link
Contributor

zeit gavon mal einen Screenshot bitte - und auch: Wenn es in der Web IDE rot unterkringelt wird heisst das erstmal nicht soo viel ... abe rja DAS müssen wir ansehen - dann ist was in den typings blöd.

Aber der Fehler kommt definieiv aus deinem Skript! Du musst vor dem Zugriff prüfen das Datenstrukturen da sind. Diesnbezüglich sollte ch n .11/12 nchs gändert

@ticaki
Copy link
Author

ticaki commented Sep 12, 2021

Das dieses Json undefiniert ist wird vorher schon abgefragt, aber der Fehler lies sich nicht reproduzieren. Damit ist er nicht existent. :)

hier ein Foto von .11 ich war heute vormittag zurück gegangen auf .9 und dort wurde setTimeout() nicht als Fehler angezeigt.
Bildschirmfoto 2021-09-12 um 16 54 56

@Apollon77
Copy link
Contributor

Das dieses Json undefiniert ist wird vorher schon abgefragt, aber der Fehler lies sich nicht reproduzieren. Damit ist er nicht existent. :)

Du meins Die Zeile mit j[a].sleep === undefined?? Darum geht es nicht!! j[a] ist undefined!!

@Apollon77 Apollon77 reopened this Sep 12, 2021
@Apollon77
Copy link
Contributor

@AlCalzone @GermanBluefox Please check the screenshot above

@AlCalzone
Copy link
Collaborator

Der Adapter kann die Typdeklarationen für Node.js nicht laden. Ich hätte schwören können, ich habe das in #878 gefixt, aber die betroffene Datei scheint da nicht enthalten zu sein.

@AlCalzone
Copy link
Collaborator

PR up at #882
grafik

@ticaki
Copy link
Author

ticaki commented Sep 13, 2021

Du meins Die Zeile mit j[a].sleep === undefined?? Darum geht es nicht!! j[a] ist undefined!!
ok, danke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants