<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[updateDom() blocks MagicMirror]]></title><description><![CDATA[<p dir="auto">Hey,</p>
<p dir="auto">I am developing my own first module. Therefore I looked at some other modules and in the dev documentation.</p>
<p dir="auto">This is what I have right now:</p>
<pre><code>Module.register("MMM-VPlan", {
	defaults: {
		fadeSpeed: 2,
                username: "",
                password: ""
	},

	getStyles: function() {
        return ["MMM-Plan.css"];
	},

    start: function() {
		Log.log("Starting module: " + this.name);
		
        this.response = {
            "name": "Test",
            "entries": {
                "lessions": "Teacher Subject Room representation"
            }
        };

		//this.getData();
        updateDom();
	},

	getDom: function() {
        const wrapper = document.createElement("div");
        wrapper.innerHTML = response;
        return wrapper;
	},

    getData: function () {
        const request = new XMLHttpRequest();
        request.open('GET', 'http://localhost/vplan/' + username + '/' + password + '/today', true);
        request.onreadystatechange = () =&gt; {
          if (request.readyState != 4) {
            return;
          };
    
          if (request.status === 200) {
            this.response = JSON.parse(request.response);
            this.updateDom();
          } else {
            Log.error(`${this.name}: Could not load data`);
          }
    
          setTimeout(() =&gt; this.getData(), this.config.updateIntervalMs);
        };
        request.send();
      },
})
</code></pre>
<p dir="auto">The getData() function is not in use.</p>
<p dir="auto">My problem is the getDom() function. If I call  updateDom() in the start method, the mirror shows only a black screen without any content. Even the other modules aren`t visible.<br />
If I delete updateDom() in the start methode, the mirror shows all modules. But my module returns undefined:</p>
<p dir="auto"><img src="/assets/uploads/files/1642791719593-undefined.png" alt="Undefined.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/topic/16235/updatedom-blocks-magicmirror</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 09:14:45 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/16235.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Jan 2022 19:04:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 15:44:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> said in <a href="/post/98873">updateDom() blocks MagicMirror</a>:</p>
<blockquote>
<p dir="auto">I installed the software like in the docs show.</p>
</blockquote>
<p dir="auto">my script fixes little odds and ends not covered by the doc</p>
]]></description><link>https://forum.magicmirror.builders/post/98875</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98875</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 22 Jan 2022 15:44:03 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 15:44:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> said in <a href="/post/98873">updateDom() blocks MagicMirror</a>:</p>
<blockquote>
<p dir="auto">So I haven`t installed pm2</p>
</blockquote>
<p dir="auto">the fixuppm2 installs it if needed</p>
<p dir="auto">but u had it installed cause you used it to launch MM…</p>
]]></description><link>https://forum.magicmirror.builders/post/98874</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98874</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 22 Jan 2022 15:44:33 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 15:41:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> I installed the software like in the docs show. So I haven`t installed pm2</p>
]]></description><link>https://forum.magicmirror.builders/post/98873</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98873</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Sat, 22 Jan 2022 15:41:29 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 15:36:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> i saw the git issue</p>
<p dir="auto">can u do pm2 info MagicMirror<br />
again</p>
]]></description><link>https://forum.magicmirror.builders/post/98871</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98871</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 22 Jan 2022 15:36:24 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 15:28:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> I installed the software again. Now it works, but I think I will see this error soon again.<br />
btw: I wrote an issues on git: <a href="https://github.com/MichMich/MagicMirror/issues/2793" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/MichMich/MagicMirror/issues/2793</a></p>
]]></description><link>https://forum.magicmirror.builders/post/98870</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98870</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Sat, 22 Jan 2022 15:28:54 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 15:17:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> ok, do this</p>
<pre><code>pm2 stop all
pm2 delete 0
pm2 save
</code></pre>
<p dir="auto">the run my <a href="http://fixuppm2.sh" target="_blank" rel="noopener noreferrer nofollow ugc">fixuppm2.sh</a> script from here<br />
<a href="https://github.com/sdetweil/MagicMirror_scripts" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/sdetweil/MagicMirror_scripts</a></p>
]]></description><link>https://forum.magicmirror.builders/post/98868</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98868</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 22 Jan 2022 15:17:25 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 14:35:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a></p>
<p dir="auto"><img src="/assets/uploads/files/1642862030334-pm2-info.png" alt="pm2 info.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1642862036810-v.png" alt="-v.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/98867</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98867</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Sat, 22 Jan 2022 14:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 14:27:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a>   ok, weird…</p>
<p dir="auto">npm -v<br />
node -v</p>
<p dir="auto">which user is pm2 installed on?</p>
<p dir="auto">pm2 info 0</p>
]]></description><link>https://forum.magicmirror.builders/post/98866</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98866</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 22 Jan 2022 14:27:00 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 13:49:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a><br />
Here is the .pm2/logs/MagicMirror-error.log<br />
<a href="https://haste.lyrotopia.net/equzexapal.js" target="_blank" rel="noopener noreferrer nofollow ugc">https://haste.lyrotopia.net/equzexapal.js</a><br />
Its always the same error</p>
<p dir="auto">Here is the .pm2/logs/MagicMirror-out.log<br />
<a href="https://haste.lyrotopia.net/mosubanoro.css" target="_blank" rel="noopener noreferrer nofollow ugc">https://haste.lyrotopia.net/mosubanoro.css</a></p>
]]></description><link>https://forum.magicmirror.builders/post/98865</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98865</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Sat, 22 Jan 2022 13:49:39 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 13:00:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> I need to see the messages output by npm start</p>
<p dir="auto">if you use pm2, then pm2 logs --lines=50</p>
<p dir="auto">also maybe info from the developers window, ctrl-shift-i on the keyboard and select the console tab and scroll up to see any errors red text</p>
]]></description><link>https://forum.magicmirror.builders/post/98862</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98862</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 22 Jan 2022 13:00:12 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Sat, 22 Jan 2022 09:30:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> Do you remember my problem yesteray that my magic mirror doesn`t start? I started the program today in the morning. Without doing anythink since yesterday evening, the same error occurs.</p>
<p dir="auto">The only think I change was that I renamed lenght to length. Than I deleted the module module and copyed the new one.</p>
<p dir="auto">old post: <a href="https://forum.magicmirror.builders/topic/16233/error-while-starting-magic-mirror/29">https://forum.magicmirror.builders/topic/16233/error-while-starting-magic-mirror/29</a></p>
]]></description><link>https://forum.magicmirror.builders/post/98860</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98860</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Sat, 22 Jan 2022 09:30:13 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 20:03:41 GMT]]></title><description><![CDATA[<p dir="auto">see the doc</p>
<p dir="auto"><a href="https://docs.magicmirror.builders/development/introduction.html#module-structure" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.magicmirror.builders/development/introduction.html#module-structure</a></p>
<p dir="auto"><a href="https://docs.magicmirror.builders/development/core-module-file.html#subclassable-module-methods" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.magicmirror.builders/development/core-module-file.html#subclassable-module-methods</a><br />
notificationReceived  in particular</p>
]]></description><link>https://forum.magicmirror.builders/post/98858</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98858</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 20:03:41 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:49:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> this.getData() is not synchronous, so it will return long before the data is ready</p>
<p dir="auto">don’t call from getDom()</p>
]]></description><link>https://forum.magicmirror.builders/post/98857</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98857</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:49:16 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:44:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> length</p>
<p dir="auto">spelling matters…</p>
<p dir="auto">use the debugger</p>
]]></description><link>https://forum.magicmirror.builders/post/98856</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98856</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:44:28 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:38:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a><br />
First: Is there an other option?</p>
<p dir="auto">Second: I added the getData() function in getDom()</p>
<pre><code>        const wrapper = document.createElement("div");
        this.getData();
        if(this.response.lenght &lt;= 0) {
            wrapper.innerHTML = "No Entries";
        } else {
            wrapper.innerHTML = JSON.stringify(this.response);
        }
        return wrapper;
</code></pre>
<p dir="auto">Now the mirror show <code>UNDEFINED</code> again</p>
]]></description><link>https://forum.magicmirror.builders/post/98855</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98855</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:38:03 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:34:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> that would work</p>
<p dir="auto">but it will be the JSON text representation of the object</p>
<p dir="auto">all fields and values</p>
]]></description><link>https://forum.magicmirror.builders/post/98854</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98854</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:34:23 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:33:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> What about <code>JSON.stringify(this.response);</code></p>
]]></description><link>https://forum.magicmirror.builders/post/98853</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98853</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:33:20 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:33:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> JSON.parse, JSON. stringify</p>
<p dir="auto">u have an object so, stringify turns it into text<br />
parse takes text and makes an object</p>
]]></description><link>https://forum.magicmirror.builders/post/98852</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98852</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:31:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> said in <a href="/post/98848">updateDom() blocks MagicMirror</a>:</p>
<blockquote>
<p dir="auto">Why can getDom() not transfrom the array in a readable string?</p>
</blockquote>
<p dir="auto">getDom() CAN do anythign YOU implement… it does NOTHING by itself…</p>
]]></description><link>https://forum.magicmirror.builders/post/98851</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98851</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:31:19 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:31:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> Is there a Json parser I can use?</p>
]]></description><link>https://forum.magicmirror.builders/post/98850</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98850</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:31:16 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:30:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> yes, this.response is an object</p>
<pre><code>        this.response = {
            "name": "Test",
            "entries": {
                "lessions": "Teacher Subject Room representation"
            }
        };
</code></pre>
<p dir="auto">html doesn’t know objects</p>
]]></description><link>https://forum.magicmirror.builders/post/98849</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98849</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:30:34 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:30:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a><br />
<img src="/assets/uploads/files/1642793345041-response.png" alt="response.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Not exectly what I wanted :joy:<br />
Why can getDom() not transfrom the array in a readable string?</p>
]]></description><link>https://forum.magicmirror.builders/post/98848</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98848</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:30:30 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:28:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/1blaunitrox" aria-label="Profile: 1blaunitrox">@<bdi>1blaunitrox</bdi></a> said in <a href="/post/98846">updateDom() blocks MagicMirror</a>:</p>
<blockquote>
<p dir="auto">if(response.lenght &lt;= 0) {</p>
</blockquote>
<p dir="auto">this.response.length</p>
<p dir="auto">always gotta use this.</p>
<p dir="auto">unless u created the variable INSIDE the routine using it…</p>
<p dir="auto">use the debugger</p>
]]></description><link>https://forum.magicmirror.builders/post/98847</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98847</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:28:22 GMT</pubDate></item><item><title><![CDATA[Reply to updateDom() blocks MagicMirror on Fri, 21 Jan 2022 19:25:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> I changed getDom() to this:</p>
<pre><code>getDom: function() {
        const wrapper = document.createElement("div");
        if(response.lenght &lt;= 0) {
            wrapper.innerHTML = "No Entries";
        } else {
            wrapper.innerHTML = this.response;
        }
        return wrapper;
	},
</code></pre>
<p dir="auto">There is a check if the array has any entries.</p>
<p dir="auto">But the mirror shows “undefined”</p>
]]></description><link>https://forum.magicmirror.builders/post/98846</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/98846</guid><dc:creator><![CDATA[1BlauNitrox]]></dc:creator><pubDate>Fri, 21 Jan 2022 19:25:15 GMT</pubDate></item></channel></rss>