Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. (gelöst) Cannot redeclare block-scoped variable

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    (gelöst) Cannot redeclare block-scoped variable

    This topic has been deleted. Only users with topic management privileges can see it.
    • ice987
      ice987 last edited by ice987

      Hallo zusammen,

      erstmals wünsche ich allen "frohe Ostern"!

      ich habe in einigen meiner Skripte die folgenden Konstanten definiert:

      //Config
      const PRAEFIX = '0_userdata.0.'; //Stammordner
      const FOLDER = 'multimedia.'; //Unterordner
      const ID0 = 'testy'; //Objekt
      

      nun gibt es mir bei diesen Skripten die folgende Meldung, und alles ist rot markiert:

      index5.js
      1 von 3 Problemen
      Cannot redeclare block-scoped variable 'PRAEFIX'.(2451)
      index5.js(2, 7): 'PRAEFIX' was also declared here.
      
      index5.js
      2 von 3 Problemen
      Cannot redeclare block-scoped variable 'FOLDER'.(2451)
      index5.js(3, 7): 'FOLDER' was also declared here.
      
      index5.js
      3 von 3 Problemen
      Cannot redeclare block-scoped variable 'ID0'.(2451)
      index5.js(4, 11): 'ID0' was also declared here.
      

      Was hat es mit dieser Fehlermeldung auf sich? Die Skripte sind nicht im Ordner "global".

      paul53 AlCalzone 2 Replies Last reply Reply Quote 0
      • paul53
        paul53 @ice987 last edited by

        @ice987 sagte: alles ist rot markiert

        Ignorieren.

        1 Reply Last reply Reply Quote 1
        • AlCalzone
          AlCalzone Developer @ice987 last edited by

          @ice987 Welche Adapter-Version?

          ice987 1 Reply Last reply Reply Quote 0
          • ice987
            ice987 @AlCalzone last edited by

            @alcalzone
            Adapter: Script Engine; v5.0.14

            AlCalzone 1 Reply Last reply Reply Quote 0
            • AlCalzone
              AlCalzone Developer @ice987 last edited by

              @ice987 Hm... ich erinnere mich dunkel dran, dass das manchmal beim Wechseln zwischen den Skript-Editoren passiert. Also einfach ignorieren.

              ice987 1 Reply Last reply Reply Quote 0
              • ice987
                ice987 @AlCalzone last edited by

                @alcalzone
                Ist "Wechseln der Skript-Editoren" so zu verstehen, dass dieser Fehler auftreten kann wenn die Skripte auf mehreren unterschiedlichen Instanzen laufen (das wäre bei mir der Fall)?

                AlCalzone 1 Reply Last reply Reply Quote 0
                • AlCalzone
                  AlCalzone Developer @ice987 last edited by

                  @ice987 Ne, wenn du erst ein Skript im Editor öffnest, dann ein anderes und dann wieder das erste. Hat mit Instanzen und der Ausführung nichts zu tun und ist rein kosmetisch.

                  ice987 1 Reply Last reply Reply Quote 1
                  • ice987
                    ice987 @AlCalzone last edited by

                    @alcalzone
                    Vielen Dank für deine Rückmeldung. Evtl. könnte dies ja in zukünftigen Versionen behoben werden. 😳

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    824
                    Online

                    31.8k
                    Users

                    80.0k
                    Topics

                    1.3m
                    Posts

                    3
                    8
                    721
                    Loading More Posts
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes
                    Reply
                    • Reply as topic
                    Log in to reply
                    Community
                    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                    The ioBroker Community 2014-2023
                    logo