Read the statement by Michael Teeuw here.
MMM-Sunrise-Sunset
-
@pugsly said in MMM-Sunrise-Sunset:
Uncaught ReferenceError: $ is not defined
this module depends on jquery library being installed for this module, but its not…,
I am working on instructions for you… hang on
do
cd ~/MagicMirror/modules/MMM-Sunrise-Sunset npm install jquery # note the trailing dot (.) on the next line cp node_modules/jquery/dist/jquery.js .then start your mirror again
-
@sdetweil said in MMM-Sunrise-Sunset:
cp node_modules/jquery/dist/jquery.js .
Slightly better, its displaying now but just says ‘Loading’
-
@pugsly ok, open the developers window again
this usually means that the api key is wrong … the api isn’t returning data
-
@sdetweil
Its not passing the API key in the HTML request.https://api.ipgeolocation.io/astronomy?apiKey=&lang=en&lat=39.2907&long=-75.6344 401
-
@pugsly said in MMM-Sunrise-Sunset:
apikey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",yep, case sensitive, it apiKey
-
@pugsly NVM… the K in apiKey is a capital. Its working now.
-
@sdetweil: Thank you so much for your help here. I’m having the exact same problem as @pugsly did, but unfortunately your suggestions seem to not do the trick. I was wondering if you could help me out, too. So far I got:
{ module: "MMM-Sunrise-Sunset", position: "bottom_bar", config: { apiKey: "xxx", latitude: "xx.03586", longitude: "xx.06379", timezone: "Europe/Berlin", layout: "inline" } },My screen stays black, though, and the developer console is giving me this:
Uncaught ReferenceError: $ is not defined at Class.updateSun (MMM-Sunrise-Sunset.js:33) at Class.start (MMM-Sunrise-Sunset.js:12) at startModules (loader.js:55) at loader.js:40 at HTMLLinkElement.stylesheet.onload (loader.js:200)I even tried executing your suggestions as root, thinking that I must’ve done something wrong, but I got the same error messages as before:
root@raspberrypi:/home/pi/MagicMirror/modules/MMM-Sunrise-Sunset# npm install jquery npm WARN saveError ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json' npm WARN enoent ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json' npm WARN modules No description npm WARN modules No repository field. npm WARN modules No README data npm WARN modules No license field. + jquery@3.4.1 removed 1 package, updated 1 package and audited 1 package in 4.09s found 0 vulnerabilities root@raspberrypi:/home/pi/MagicMirror/modules/MMM-Sunrise-Sunset# cp node/modules/jquery/dist/jquery.js . cp: cannot stat 'node/modules/jquery/dist/jquery.js': No such file or directoryWhat am I missing here?
-
@dankerthrone said in MMM-Sunrise-Sunset:
Uncaught ReferenceError: $ is not defined
cp node/modules/jquery/dist/jquery.js .should be (notice the underscore, _ instead of the slash /)
cp node_modules/jquery/dist/jquery.js . -
That seems to have been a copy/paste-error. My terminal history shows it with the underscore. To make sure, I tried it once again, but still get
pi@raspberrypi:~/MagicMirror/modules/MMM-Sunrise-Sunset $ cp node_modules/jquery/dist/jquery.js . cp: cannot stat 'node_modules/jquery/dist/jquery.js': No such file or directory -
@dankerthrone weird
show the output ofcd ~/MagicMirror/modules/MMM-Sunrise-Sunset ls node_modules -laF -
pi@raspberrypi:~/MagicMirror/modules/MMM-Sunrise-Sunset $ ls node_modules -laF ls: cannot access 'node_modules': No such file or directory… I’m starting to wonder if I messed up something bigger in the beginning since almost any change I apply to config.js results in weird errors.
-
after rebooting, the black screen of MagicMirror now shows this in the developer console:
Starting module: MMM-Sunrise-Sunset MMM-Sunrise-Sunset.js:50 Uncaught ReferenceError: $ is not defined at Class.updateSun (MMM-Sunrise-Sunset.js:50) at Class.start (MMM-Sunrise-Sunset.js:12) at startModules (loader.js:55) at loader.js:40 at HTMLLinkElement.stylesheet.onload (loader.js:200) DailyXKCD.js:77 https://imgs.xkcd.com/comics/hotel_room_party.png 7 DailyXKCD.js:177 Uncaught TypeError: Cannot read property 'naturalHeight' of null at Class.scrollComic (DailyXKCD.js:177) at DailyXKCD.js:51 6 DailyXKCD.js:177 Uncaught TypeError: Cannot read property 'naturalHeight' of null at Class.scrollComic (DailyXKCD.js:177) at DailyXKCD.js:51I’m really starting to think I do something stupid everytime I install/clone a module from github. I do follow each readme.md for installation, but somehow keep messing up :-/
-
@dankerthrone installing a new module is pretty easy
cd MagicMirror/modules git clone http:// the url of the git repo cd the name of the moduleif there is a package.,json file, then to load its dependencies do
npm installthen
cd ~/MagicMirror/config nano config.js insert the module definition info, (see the module readme.md) savethen restart mirror app
this module does NOT list its dependency on jquery as it should
so, you have to fix it manually.SO, i don’t know where you were when u did the npm install jquery
lets find itcd ~/MagicMirror find . | grep jquery\.js -
@dankerthrone said in MMM-Sunrise-Sunset:
DailyXKCD
the XKCD errors look like poor programming by the author
he tries to find the web content before its there, but doesn’t check if he got the location
-
@sdetweil
finding jquery as you suggested returnspi@raspberrypi:~/MagicMirror $ find . | grep jquery\.js ./node_modules/nwmatcher/src/modules/nwmatcher-jquery.js -
@dankerthrone hm… not where I would have expected it…
so. lets try this again
cd ~/MagicMirror/modules/MMM-Sunrise-Sunset npm install jquery ls node_modules/jqueryyou should see this
AUTHORS.txt LICENSE.txt README.md bower.json dist external package.json srcthen do
cp node_modules/jquery/dist/jquery.js .then
ls jquery.jsto prove the file is in the module folder
i just did it all here step by step
-
Late to the game, but I also am getting black screen after installing the module and adding it to my config. Ill try to give you the steps:
Did the git pull. Went into the folder, npm install.
Added this to my config:
{ module: 'MMM-Sunrise-Sunset', position: "bottom_center", config: { latitude: "69.13", longitude: "18.59", apiKey: "myAPI", layout: "inline", } },I also tried @sdetweil post, without any difference. I find the files as listed, did pm2 restart mm without any help.
Ideas?
-
@siggmur latitude and longitude are numbers, remove the quotes.
general rule, for values to the right of :
number or true/false - not quoted
all else, quoted, doesn’t matter which one, just matching.
also, lat/long usually are 6 digits
xx.yyyy -
Thanks for the quick reply, I forgot the quotation marks, but it should throw a config error, not a black screen like I am getting?
-
@siggmur black screen usually means missing library file.
look at the startup.messageseither
pm2 logs --lines=100
or the terminal window where do
npm start
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login