![]() The Magic Mirror is the recurring magical item found in the legend of Snow White, and is the means by which the Evil Queen ensures that she alone is the "fairest in the land" - asking it daily the question of "who is the fairest of them all?", in fact, it is only when the Magic Mirror tells the Evil Queen that Snow White surpasses her in fairness that she plans on having her killed. ~ Last words of the Spirit of the Magic Mirror to Aqua before disappearing in Kingdom Hearts: Birth by Sleep. home/pi/MagicMirror/config/config.~ The Magic Mirror in Disney's Snow White and the Seven Dwarves. Here is an example for a common output of the check: > config:check /home/pi/MagicMirrorĬhecking file. If you use nano as editor for your console, don't forget the -c flag which includes line numbers nano -c config/config.js Move into the respective line in the config.js and find the error. It will create an output showing all syntax errors. Run this in the Magic Mirror folder npm run config:check That is quite a challenge, especially if you're using the console or simple text editors to edit config.js.įortunately there is an easy-to-understand implemented config check (a so-called js linter). It is javascript code and gets included into the MM framework in runtime, meaning it needs to be free of any syntax errors. The config.js file is a challenge for new users. Copy it and paste it together with your issue on github or on the forum. Found anything in red color? That will probably need to be fixed. Here you will find an output of messages, together with the. Here you can choose between the console output, the DOM elements, debugging functions and possibly styling functions.įor now you are looking for the 'console' part. Now press F12 (or ctrl+i) and you will see the so-called developer's tools. If you have a running system (via pm2, or one of the node commands node serveronly, npm start dev etc), your browser will build up the mirror frontend. You may have also changed the port in config.js. Open your browser and type into the address field Here you obviously need to use another host name (instead of magicmirror) if you have changed it. To debug the front-end side (anything that is in your main.js) you can use your browser on the laptop or computer. 2.3 - Debugging main.js 2.3.1 - Using the browser to debug front-end Then start pm2 again using the command pm2 restart mm or however the alias of your MM instance ins named. If you want to post an issue to the forum or to github, it's best to attach an output of this. Here you can have a look if your module creates an error. It is important to stop all instances of the mirror before starting here, otherwise the dev mode won't work because the port (usually 8080) is blocked by the other instance.Ībove command will throw out all messages from the server side that are sent to the console and that you usually wouldn't see. 2.2.2 - npm dev modeĪ more general way is to use the included npm dev mode. You're especally interested in the error logs (usually red), so have a look there for anything related to your module. Pm2 will throw out a tail of the last logs in three different categories: pm2 system logs, error logs, and info logs. You can add the flag -lines xx to include more lines. If you have pm2 installed it is possible to check for errors in a running system using the command pm2 logs The server side of the mirror works in the background, usually you can't directly see the errors the modules create here. Set it to true to receive much more debugging output. THe config options for my modules generally include a debug function. This is valid for my modules oand some others, but not nearly all. You can do this workflow from start to finish to check for all obvious issues or check specific parts coming from part 1 above. There are many possible reasons for that but it's worthwile to have a look at css. Check out debugging node_helper 1.4 - My module shows up but looks weired You may have a problem at the server side, probably in the node_helper. Check out debugging main.js 1.3 - My module won't update There probably is a syntax error in your module. Check out debugging main.jsġ.2 - My module won't show / won't show complete / shows unexpected behaviour the DOM (document object model, which is the sum of objects in the HTML document created by the code) could not be created due to syntax errors.config.js is probably not interpretable anymore.There are two main issues that you'll face: 1.1 - The mirror won't show It is to the most part valid for any Magic Mirror module out there but especially directed to my modules and their debugging function. ![]() This documentation describes the workflow to debug Magic Mirror modules. ![]()
0 Comments
Leave a Reply. |